From c9416f0ac9d9f79bdfae5d5b848dcd08e79af034 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnychenko Date: Fri, 12 Jul 2024 16:42:31 +0300 Subject: [PATCH] PSMDB-1481 psmdb80: add build pipeline jobs --- psmdb/jenkins/get-psmdb-branches-8.0.groovy | 115 +++++ psmdb/jenkins/get-psmdb-branches-8.0.yml | 17 + ...cona-server-for-mongodb-8.0-aarch64.groovy | 269 +++++++++++ ...percona-server-for-mongodb-8.0-aarch64.yml | 15 + .../percona-server-for-mongodb-8.0.groovy | 419 ++++++++++++++++++ .../percona-server-for-mongodb-8.0.yml | 15 + 6 files changed, 850 insertions(+) create mode 100644 psmdb/jenkins/get-psmdb-branches-8.0.groovy create mode 100644 psmdb/jenkins/get-psmdb-branches-8.0.yml create mode 100644 psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.groovy create mode 100644 psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.yml create mode 100644 psmdb/jenkins/percona-server-for-mongodb-8.0.groovy create mode 100644 psmdb/jenkins/percona-server-for-mongodb-8.0.yml diff --git a/psmdb/jenkins/get-psmdb-branches-8.0.groovy b/psmdb/jenkins/get-psmdb-branches-8.0.groovy new file mode 100644 index 0000000000..0445905748 --- /dev/null +++ b/psmdb/jenkins/get-psmdb-branches-8.0.groovy @@ -0,0 +1,115 @@ +library changelog: false, identifier: 'lib@master', retriever: modernSCM([ + $class: 'GitSCMSource', + remote: 'https://github.com/Percona-Lab/jenkins-pipelines.git' +]) _ + +pipeline { + agent { + label 'docker' + } + parameters { + string( + defaultValue: 'https://github.com/percona/percona-server-mongodb.git', + description: 'URL for percona-server-for-mongodb repository', + name: 'GIT_REPO') + } + options { + skipDefaultCheckout() + disableConcurrentBuilds() + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) + timestamps () + } + stages { + stage('Get release branches') { + steps { + withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AWS_STASH', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { + sh """ + EC=0 + aws s3 ls s3://percona-jenkins-artifactory/percona-server-mongodb/branch_commit_id_80.properties || EC=\$? + + if [ \${EC} = 1 ]; then + LATEST_RELEASE_BRANCH=\$(git -c 'versionsort.suffix=-' ls-remote --heads --sort='v:refname' ${GIT_REPO} release-8.0\\* | tail -1) + BRANCH_NAME=\$(echo \${LATEST_RELEASE_BRANCH} | cut -d "/" -f 3) + COMMIT_ID=\$(echo \${LATEST_RELEASE_BRANCH} | cut -d " " -f 1) + MONGO_TOOLS_TAG_LINK=\$(echo ${GIT_REPO} | sed -re 's|github.com|raw.githubusercontent.com|; s|\\.git\$||') + MONGO_TOOLS_TAG=\$(curl \${MONGO_TOOLS_TAG_LINK}/\${BRANCH_NAME}/MONGO_TOOLS_TAG_VERSION) + + echo "BRANCH_NAME=\${BRANCH_NAME}" > branch_commit_id_80.properties + echo "COMMIT_ID=\${COMMIT_ID}" >> branch_commit_id_80.properties + echo "MONGO_TOOLS_TAG=\${MONGO_TOOLS_TAG}" >> branch_commit_id_80.properties + + aws s3 cp branch_commit_id_80.properties s3://percona-jenkins-artifactory/percona-server-mongodb/ + echo "START_NEW_BUILD=NO" > startBuild + else + aws s3 cp s3://percona-jenkins-artifactory/percona-server-mongodb/branch_commit_id_80.properties . + source branch_commit_id_80.properties + + LATEST_RELEASE_BRANCH=\$(git -c 'versionsort.suffix=-' ls-remote --heads --sort='v:refname' ${GIT_REPO} release-8.0\\* | tail -1) + LATEST_BRANCH_NAME=\$(echo \${LATEST_RELEASE_BRANCH} | cut -d "/" -f 3) + LATEST_COMMIT_ID=\$(echo \${LATEST_RELEASE_BRANCH} | cut -d " " -f 1) + MONGO_TOOLS_TAG_LINK=\$(echo ${GIT_REPO} | sed -re 's|github.com|raw.githubusercontent.com|; s|\\.git\$||') + MONGO_TOOLS_TAG=\$(curl \${MONGO_TOOLS_TAG_LINK}/\${LATEST_BRANCH_NAME}/MONGO_TOOLS_TAG_VERSION) + + if [ "x\${COMMIT_ID}" != "x\${LATEST_COMMIT_ID}" ] || [ "x\${BRANCH_NAME}" != "x\${LATEST_BRANCH_NAME}" ]; then + echo "START_NEW_BUILD=YES" > startBuild + else + echo "START_NEW_BUILD=NO" > startBuild + fi + + echo "BRANCH_NAME=\${LATEST_BRANCH_NAME}" > branch_commit_id_80.properties + echo "COMMIT_ID=\${LATEST_COMMIT_ID}" >> branch_commit_id_80.properties + echo "MONGO_TOOLS_TAG=\${MONGO_TOOLS_TAG}" >> branch_commit_id_80.properties + aws s3 cp branch_commit_id_80.properties s3://percona-jenkins-artifactory/percona-server-mongodb/ + fi + """ + } + script { + START_NEW_BUILD = sh(returnStdout: true, script: "source startBuild; echo \${START_NEW_BUILD}").trim() + BRANCH_NAME = sh(returnStdout: true, script: "source branch_commit_id_80.properties; echo \${BRANCH_NAME}").trim() + COMMIT_ID = sh(returnStdout: true, script: "source branch_commit_id_80.properties; echo \${COMMIT_ID}").trim() + VERSION = sh(returnStdout: true, script: "source branch_commit_id_80.properties; echo \${BRANCH_NAME} | cut -d - -f 2 ").trim() + RELEASE = sh(returnStdout: true, script: "source branch_commit_id_80.properties; echo \${BRANCH_NAME} | cut -d - -f 3 ").trim() + MONGO_TOOLS_TAG = sh(returnStdout: true, script: "source branch_commit_id_80.properties; echo \${MONGO_TOOLS_TAG}").trim() + } + + } + + } + stage('Build needed') { + when { + expression { START_NEW_BUILD == 'YES' } + } + steps { + withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AWS_STASH', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { + sh """ + echo ${START_NEW_BUILD}: build required + """ + } + slackNotify("#releases-ci", "#00FF00", "[${JOB_NAME}]: new changes for branch ${BRANCH_NAME}[commit id: ${COMMIT_ID}] were detected, build will be started soon") + build job: 'psmdb80-autobuild-RELEASE', parameters: [string(name: 'GIT_BRANCH', value: BRANCH_NAME), string(name: 'PSMDB_VERSION', value: VERSION), string(name: 'PSMDB_RELEASE', value: RELEASE), string(name: 'MONGO_TOOLS_TAG', value: MONGO_TOOLS_TAG), string(name: 'COMPONENT', value: 'testing')] + build job: 'psmdb80-aarch64-build', parameters: [string(name: 'GIT_BRANCH', value: BRANCH_NAME), string(name: 'PSMDB_VERSION', value: VERSION), string(name: 'PSMDB_RELEASE', value: RELEASE), string(name: 'MONGO_TOOLS_TAG', value: MONGO_TOOLS_TAG), string(name: 'COMPONENT', value: 'testing')] + build job: 'psmdb-multijob-testing', propagate: false, wait: false, parameters: [string(name: 'PSMDB_VERSION', value: VERSION), string(name: 'PSMDB_RELEASE', value: RELEASE)] + } + } + stage('Build skipped') { + when { + expression { START_NEW_BUILD == 'NO' } + } + steps { + withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AWS_STASH', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) { + sh """ + echo ${START_NEW_BUILD} build required + """ + } + } + } + } + post { + always { + sh ''' + sudo rm -rf ./* + ''' + deleteDir() + } + } +} diff --git a/psmdb/jenkins/get-psmdb-branches-8.0.yml b/psmdb/jenkins/get-psmdb-branches-8.0.yml new file mode 100644 index 0000000000..b02245500b --- /dev/null +++ b/psmdb/jenkins/get-psmdb-branches-8.0.yml @@ -0,0 +1,17 @@ +- job: + name: psmdb80-autobuild + project-type: pipeline + description: | + Do not edit this job through the web! + Check PSMDB repo for new release branches to build packages + pipeline-scm: + scm: + - git: + url: https://github.com/Percona-Lab/jenkins-pipelines.git + branches: + - 'masgter' + wipe-workspace: false + lightweight-checkout: true + script-path: psmdb/jenkins/get-psmdb-branches-8.0.groovy + triggers: + - timed: "H/15 * * * *" diff --git a/psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.groovy b/psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.groovy new file mode 100644 index 0000000000..7429c7083a --- /dev/null +++ b/psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.groovy @@ -0,0 +1,269 @@ +library changelog: false, identifier: 'lib@master', retriever: modernSCM([ + $class: 'GitSCMSource', + remote: 'https://github.com/Percona-Lab/jenkins-pipelines.git' +]) _ + +void buildStage(String DOCKER_OS, String STAGE_PARAM) { + sh """ + set -o xtrace + mkdir test + wget \$(echo ${GIT_REPO} | sed -re 's|github.com|raw.githubusercontent.com|; s|\\.git\$||')/${GIT_BRANCH}/percona-packaging/scripts/psmdb_builder.sh -O psmdb_builder.sh + pwd -P + ls -laR + export build_dir=\$(pwd -P) + docker run -u root -v \${build_dir}:\${build_dir} ${DOCKER_OS} sh -c " + set -o xtrace + cd \${build_dir} + bash -x ./psmdb_builder.sh --builddir=\${build_dir}/test --install_deps=1 + bash -x ./psmdb_builder.sh --builddir=\${build_dir}/test --repo=${GIT_REPO} --branch=${GIT_BRANCH} --psm_ver=${PSMDB_VERSION} --psm_release=${PSMDB_RELEASE} --mongo_tools_tag=${MONGO_TOOLS_TAG} ${STAGE_PARAM}" + """ +} + +void cleanUpWS() { + sh """ + sudo rm -rf ./* + """ +} + +def AWS_STASH_PATH + +pipeline { + agent { + label 'master' + } + parameters { + string( + defaultValue: 'https://github.com/percona/percona-server-mongodb.git', + description: 'URL for percona-server-mongodb repository', + name: 'GIT_REPO') + string( + defaultValue: 'v8.0', + description: 'Tag/Branch for percona-server-mongodb repository', + name: 'GIT_BRANCH') + string( + defaultValue: '8.0.0', + description: 'PSMDB release value', + name: 'PSMDB_VERSION') + string( + defaultValue: '1', + description: 'PSMDB release value', + name: 'PSMDB_RELEASE') + string( + defaultValue: '100.9.5', + description: 'https://docs.mongodb.com/database-tools/installation/', + name: 'MONGO_TOOLS_TAG') + string( + defaultValue: 'psmdb-80', + description: 'PSMDB repo name', + name: 'PSMDB_REPO') + choice( + choices: 'no\nyes', + description: 'Enable fipsmode', + name: 'FIPSMODE') + choice( + choices: 'laboratory\ntesting\nexperimental', + description: 'Repo component to push packages to', + name: 'COMPONENT') + } + options { + skipDefaultCheckout() + disableConcurrentBuilds() + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) + timestamps () + } + stages { + stage('Create PSMDB source tarball') { + agent { + label 'docker-64gb-aarch64' + } + steps { + slackNotify("#releases-ci", "#00FF00", "[${JOB_NAME}]: starting build for ${GIT_BRANCH} - [${BUILD_URL}]") + cleanUpWS() + buildStage("oraclelinux:8", "--get_sources=1") + sh ''' + REPO_UPLOAD_PATH=$(grep "UPLOAD" test/percona-server-mongodb-80.properties | cut -d = -f 2 | sed "s:$:${BUILD_NUMBER}:") + AWS_STASH_PATH=$(echo ${REPO_UPLOAD_PATH} | sed "s:UPLOAD/experimental/::") + echo ${REPO_UPLOAD_PATH} > uploadPath + echo ${AWS_STASH_PATH} > awsUploadPath + cat test/percona-server-mongodb-80.properties + cat uploadPath + cat awsUploadPath + ''' + script { + AWS_STASH_PATH = sh(returnStdout: true, script: "cat awsUploadPath").trim() + } + stash includes: 'uploadPath', name: 'uploadPath' + pushArtifactFolder("source_tarball/", AWS_STASH_PATH) + uploadTarballfromAWS("source_tarball/", AWS_STASH_PATH, 'source') + } + } + stage('Build PSMDB generic source packages') { + parallel { + stage('Build PSMDB generic source rpm') { + agent { + label 'docker-64gb-aarch64' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:8", "--build_src_rpm=1 --enable_fipsmode=1") + } else { + buildStage("oraclelinux:8", "--build_src_rpm=1") + } + } + + pushArtifactFolder("srpm/", AWS_STASH_PATH) + uploadRPMfromAWS("srpm/", AWS_STASH_PATH) + } + } + stage('Build PSMDB generic source deb') { + agent { + label 'docker-64gb-aarch64' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:focal", "--build_src_deb=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:focal", "--build_src_deb=1") + } + } + + pushArtifactFolder("source_deb/", AWS_STASH_PATH) + uploadRPMfromAWS("source_deb/", AWS_STASH_PATH) + } + } + } //parallel + } // stage + stage('Build PSMDB aarch64 Packages') { + parallel { + stage('Oracle Linux 8') { + agent { + label 'docker-64gb-aarch64' + } + steps { + cleanUpWS() + popArtifactFolder("srpm/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:8", "--build_rpm=1 --enable_fipsmode=1") + } else { + buildStage("oraclelinux:8", "--build_rpm=1") + } + } + + pushArtifactFolder("rpm/", AWS_STASH_PATH) + uploadRPMfromAWS("rpm/", AWS_STASH_PATH) + } + } + stage('Oracle Linux 9') { + agent { + label 'docker-64gb-aarch64' + } + steps { + cleanUpWS() + popArtifactFolder("srpm/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:9", "--build_rpm=1 --enable_fipsmode=1") + } else { + buildStage("oraclelinux:9", "--build_rpm=1") + } + } + + pushArtifactFolder("rpm/", AWS_STASH_PATH) + uploadRPMfromAWS("rpm/", AWS_STASH_PATH) + } + } + stage('Ubuntu 20.04') { + agent { + label 'docker-64gb-aarch64' + } + steps { + cleanUpWS() + popArtifactFolder("source_deb/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:focal", "--build_deb=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:focal", "--build_deb=1") + } + } + + pushArtifactFolder("deb/", AWS_STASH_PATH) + uploadDEBfromAWS("deb/", AWS_STASH_PATH) + } + } + stage('Ubuntu 22.04') { + agent { + label 'docker-64gb-aarch64' + } + steps { + cleanUpWS() + popArtifactFolder("source_deb/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:jammy", "--build_deb=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:jammy", "--build_deb=1") + } + } + + pushArtifactFolder("deb/", AWS_STASH_PATH) + uploadDEBfromAWS("deb/", AWS_STASH_PATH) + } + } + } + } + + stage('Sign packages') { + steps { + signRPM() + signDEB() + } + } + stage('Push to public repository') { + steps { + // sync packages + script { + if (env.FIPSMODE == 'yes') { + sync2PrivateProdAutoBuild(PSMDB_REPO+"-pro", COMPONENT) + } else { + sync2ProdAutoBuild(PSMDB_REPO, COMPONENT) + } + } + } + } + } + post { + success { + script { + if (env.FIPSMODE == 'YES') { + slackNotify("#releases", "#00FF00", "[${JOB_NAME}]: PRO build has been finished successfully for ${GIT_BRANCH} - [${BUILD_URL}]") + } else { + slackNotify("#releases", "#00FF00", "[${JOB_NAME}]: build has been finished successfully for ${GIT_BRANCH} - [${BUILD_URL}]") + } + if (env.FIPSMODE == 'YES') { + currentBuild.description = "!!! PRO Built on ${GIT_BRANCH}. Path to packages: experimental/${AWS_STASH_PATH}" + } else { + currentBuild.description = "Built on ${GIT_BRANCH}. Path to packages: experimental/${AWS_STASH_PATH}" + } + } + deleteDir() + } + failure { + slackNotify("#releases-ci", "#FF0000", "[${JOB_NAME}]: build failed for ${GIT_BRANCH} - [${BUILD_URL}]") + deleteDir() + } + always { + sh ''' + sudo rm -rf ./* + ''' + deleteDir() + } + } +} diff --git a/psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.yml b/psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.yml new file mode 100644 index 0000000000..ff943cc6d3 --- /dev/null +++ b/psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.yml @@ -0,0 +1,15 @@ +- job: + name: psmdb80-aarch64-build + project-type: pipeline + description: | + Do not edit this job through the web! + pipeline-scm: + scm: + - git: + url: https://github.com/Percona-Lab/jenkins-pipelines.git + branches: + - 'master' + wipe-workspace: false + lightweight-checkout: true + script-path: psmdb/jenkins/percona-server-for-mongodb-8.0-aarch64.groovy + diff --git a/psmdb/jenkins/percona-server-for-mongodb-8.0.groovy b/psmdb/jenkins/percona-server-for-mongodb-8.0.groovy new file mode 100644 index 0000000000..77c907ee2b --- /dev/null +++ b/psmdb/jenkins/percona-server-for-mongodb-8.0.groovy @@ -0,0 +1,419 @@ +library changelog: false, identifier: 'lib@master', retriever: modernSCM([ + $class: 'GitSCMSource', + remote: 'https://github.com/Percona-Lab/jenkins-pipelines.git' +]) _ + +void buildStage(String DOCKER_OS, String STAGE_PARAM) { + sh """ + set -o xtrace + mkdir test + wget \$(echo ${GIT_REPO} | sed -re 's|github.com|raw.githubusercontent.com|; s|\\.git\$||')/${GIT_BRANCH}/percona-packaging/scripts/psmdb_builder.sh -O psmdb_builder.sh + pwd -P + ls -laR + export build_dir=\$(pwd -P) + docker run -u root -v \${build_dir}:\${build_dir} ${DOCKER_OS} sh -c " + set -o xtrace + cd \${build_dir} + bash -x ./psmdb_builder.sh --builddir=\${build_dir}/test --install_deps=1 + bash -x ./psmdb_builder.sh --builddir=\${build_dir}/test --repo=${GIT_REPO} --branch=${GIT_BRANCH} --psm_ver=${PSMDB_VERSION} --psm_release=${PSMDB_RELEASE} --mongo_tools_tag=${MONGO_TOOLS_TAG} ${STAGE_PARAM}" + """ +} + +void cleanUpWS() { + sh """ + sudo rm -rf ./* + """ +} + +def AWS_STASH_PATH + +pipeline { + agent { + label 'micro-amazon' + } + parameters { + string( + defaultValue: 'https://github.com/percona/percona-server-mongodb.git', + description: 'URL for percona-server-mongodb repository', + name: 'GIT_REPO') + string( + defaultValue: 'v8.0', + description: 'Tag/Branch for percona-server-mongodb repository', + name: 'GIT_BRANCH') + string( + defaultValue: '8.0.0', + description: 'PSMDB release value', + name: 'PSMDB_VERSION') + string( + defaultValue: '1', + description: 'PSMDB release value', + name: 'PSMDB_RELEASE') + string( + defaultValue: '100.9.5', + description: 'https://docs.mongodb.com/database-tools/installation/', + name: 'MONGO_TOOLS_TAG') + string( + defaultValue: 'psmdb-80', + description: 'PSMDB repo name', + name: 'PSMDB_REPO') + choice( + choices: 'no\nyes', + description: 'Enable fipsmode', + name: 'FIPSMODE') + choice( + choices: 'laboratory\ntesting\nexperimental', + description: 'Repo component to push packages to', + name: 'COMPONENT') + } + options { + skipDefaultCheckout() + disableConcurrentBuilds() + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) + timestamps () + } + stages { + stage('Create PSMDB source tarball') { + agent { + label 'docker' + } + steps { + slackNotify("#releases-ci", "#00FF00", "[${JOB_NAME}]: starting build for ${GIT_BRANCH} - [${BUILD_URL}]") + cleanUpWS() + buildStage("oraclelinux:8", "--get_sources=1") + sh ''' + REPO_UPLOAD_PATH=$(grep "UPLOAD" test/percona-server-mongodb-80.properties | cut -d = -f 2 | sed "s:$:${BUILD_NUMBER}:") + AWS_STASH_PATH=$(echo ${REPO_UPLOAD_PATH} | sed "s:UPLOAD/experimental/::") + echo ${REPO_UPLOAD_PATH} > uploadPath + echo ${AWS_STASH_PATH} > awsUploadPath + cat test/percona-server-mongodb-80.properties + cat uploadPath + cat awsUploadPath + ''' + script { + AWS_STASH_PATH = sh(returnStdout: true, script: "cat awsUploadPath").trim() + } + stash includes: 'uploadPath', name: 'uploadPath' + pushArtifactFolder("source_tarball/", AWS_STASH_PATH) + uploadTarballfromAWS("source_tarball/", AWS_STASH_PATH, 'source') + } + } + stage('Build PSMDB generic source packages') { + parallel { + stage('Build PSMDB generic source rpm') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:8", "--build_src_rpm=1 --enable_fipsmode=1") + } else { + buildStage("oraclelinux:8", "--build_src_rpm=1") + } + } + + pushArtifactFolder("srpm/", AWS_STASH_PATH) + uploadRPMfromAWS("srpm/", AWS_STASH_PATH) + } + } + stage('Build PSMDB generic source deb') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:focal", "--build_src_deb=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:focal", "--build_src_deb=1") + } + } + pushArtifactFolder("source_deb/", AWS_STASH_PATH) + uploadDEBfromAWS("source_deb/", AWS_STASH_PATH) + } + } + } //parallel + } // stage + stage('Build PSMDB RPMs/DEBs/Binary tarballs') { + parallel { + stage('Oracle Linux 8') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("srpm/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:8", "--build_rpm=1 --enable_fipsmode=1") + } else { + buildStage("oraclelinux:8", "--build_rpm=1") + } + } + + pushArtifactFolder("rpm/", AWS_STASH_PATH) + uploadRPMfromAWS("rpm/", AWS_STASH_PATH) + } + } + stage('Oracle Linux 9') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("srpm/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:9", "--build_rpm=1 --enable_fipsmode=1") + } else { + buildStage("oraclelinux:9", "--build_rpm=1") + } + } + + pushArtifactFolder("rpm/", AWS_STASH_PATH) + uploadRPMfromAWS("rpm/", AWS_STASH_PATH) + } + } + stage('Ubuntu Focal(20.04)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_deb/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:focal", "--build_deb=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:focal", "--build_deb=1") + } + } + + pushArtifactFolder("deb/", AWS_STASH_PATH) + uploadDEBfromAWS("deb/", AWS_STASH_PATH) + } + } + stage('Ubuntu Jammy(22.04)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_deb/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:jammy", "--build_deb=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:jammy", "--build_deb=1") + } + } + + pushArtifactFolder("deb/", AWS_STASH_PATH) + uploadDEBfromAWS("deb/", AWS_STASH_PATH) + } + } +/* + stage('Debian Bullseye(11)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_deb/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("debian:bullseye", "--build_deb=1 --enable_fipsmode=1") + } else { + buildStage("debian:bullseye", "--build_deb=1") + } + } + + pushArtifactFolder("deb/", AWS_STASH_PATH) + uploadDEBfromAWS("deb/", AWS_STASH_PATH) + } + } +*/ + stage('Debian Bookworm(12)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_deb/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("debian:bookworm", "--build_deb=1 --enable_fipsmode=1") + } else { + buildStage("debian:bookworm", "--build_deb=1") + } + } + + pushArtifactFolder("deb/", AWS_STASH_PATH) + uploadDEBfromAWS("deb/", AWS_STASH_PATH) + } + } + stage('Oracle Linux 8 binary tarball(glibc2.28)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:8", "--build_tarball=1 --enable_fipsmode=1") + pushArtifactFolder("tarball/", AWS_STASH_PATH) + uploadTarballfromAWS("tarball/", AWS_STASH_PATH, 'binary') + } else { + echo "The step is skipped ..." + } + } + } + } + stage('Oracle Linux 9 binary tarball(glibc2.34)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("oraclelinux:9", "--build_tarball=1 --enable_fipsmode=1") + pushArtifactFolder("tarball/", AWS_STASH_PATH) + uploadTarballfromAWS("tarball/", AWS_STASH_PATH, 'binary') + } else { + echo "The step is skipped ..." + } + } + } + } + stage('Ubuntu Jammy(22.04) binary tarball(glibc2.35)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:jammy", "--build_tarball=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:jammy", "--build_tarball=1") + } + pushArtifactFolder("tarball/", AWS_STASH_PATH) + uploadTarballfromAWS("tarball/", AWS_STASH_PATH, 'binary') + } + } + } +/* + stage('Ubuntu Jammy(22.04) debug binary tarball(glibc2.35)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("ubuntu:jammy", "--debug=1 --enable_fipsmode=1") + } else { + buildStage("ubuntu:jammy", "--debug=1") + } + pushArtifactFolder("debug/", AWS_STASH_PATH) + } + } + } +*/ + stage('Debian Bookworm(12) binary tarball(glibc2.36)') { + agent { + label 'docker-64gb' + } + steps { + cleanUpWS() + popArtifactFolder("source_tarball/", AWS_STASH_PATH) + script { + if (env.FIPSMODE == 'yes') { + buildStage("debian:bookworm", "--build_tarball=1 --enable_fipsmode=1") + pushArtifactFolder("tarball/", AWS_STASH_PATH) + uploadTarballfromAWS("tarball/", AWS_STASH_PATH, 'binary') + } else { + echo "The step is skipped ..." + } + } + } + } + } + } + + stage('Sign packages') { + steps { + signRPM() + signDEB() + } + } + stage('Push to public repository') { + steps { + // sync packages + script { + if (env.FIPSMODE == 'yes') { + sync2PrivateProdAutoBuild(PSMDB_REPO+"-pro", COMPONENT) + } else { + sync2ProdAutoBuild(PSMDB_REPO, COMPONENT) + } + } + } + } + stage('Push Tarballs to TESTING download area') { + steps { + script { + if (env.FIPSMODE == 'yes') { + try { + uploadTarballToDownloadsTesting("psmdb-gated", "${PSMDB_VERSION}") + } + catch (err) { + echo "Caught: ${err}" + currentBuild.result = 'UNSTABLE' + } + } else { + try { + uploadTarballToDownloadsTesting("psmdb", "${PSMDB_VERSION}") + } + catch (err) { + echo "Caught: ${err}" + currentBuild.result = 'UNSTABLE' + } + } + } + } + } + + } + post { + success { + slackNotify("#releases-ci", "#00FF00", "[${JOB_NAME}]: build has been finished successfully for ${GIT_BRANCH} - [${BUILD_URL}]") + script { + if (env.FIPSMODE == 'yes') { + currentBuild.description = "!!! PRO Built on ${GIT_BRANCH}. Path to packages: experimental/${AWS_STASH_PATH}" + } else { + currentBuild.description = "Built on ${GIT_BRANCH}. Path to packages: experimental/${AWS_STASH_PATH}" + } + } + deleteDir() + } + failure { + slackNotify("#releases-ci", "#FF0000", "[${JOB_NAME}]: build failed for ${GIT_BRANCH} - [${BUILD_URL}]") + deleteDir() + } + always { + sh ''' + sudo rm -rf ./* + ''' + deleteDir() + } + } +} diff --git a/psmdb/jenkins/percona-server-for-mongodb-8.0.yml b/psmdb/jenkins/percona-server-for-mongodb-8.0.yml new file mode 100644 index 0000000000..a72222a31b --- /dev/null +++ b/psmdb/jenkins/percona-server-for-mongodb-8.0.yml @@ -0,0 +1,15 @@ +- job: + name: psmdb80-autobuild-RELEASE + project-type: pipeline + description: | + Do not edit this job through the web! + pipeline-scm: + scm: + - git: + url: https://github.com/Percona-Lab/jenkins-pipelines.git + branches: + - 'master' + wipe-workspace: false + lightweight-checkout: true + script-path: psmdb/jenkins/percona-server-for-mongodb-8.0.groovy +