From 1c7881a550b98a6f1710be7a1be6da52b117b97f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 14 Mar 2022 10:50:04 +0000 Subject: [PATCH 01/28] ci: Daily Releasable Artifacts pipeline --- .ci/jobs/apm-server-package-mbp.yml | 53 ++++++++++ .ci/packaging.groovy | 153 ++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+) create mode 100644 .ci/jobs/apm-server-package-mbp.yml create mode 100644 .ci/packaging.groovy diff --git a/.ci/jobs/apm-server-package-mbp.yml b/.ci/jobs/apm-server-package-mbp.yml new file mode 100644 index 00000000000..0ea7020db39 --- /dev/null +++ b/.ci/jobs/apm-server-package-mbp.yml @@ -0,0 +1,53 @@ +--- +- job: + name: apm-server/apm-server-mbp + display-name: APM Server + description: APM Server + project-type: multibranch + concurrent: true + script-path: .ci/packaging.groovy + scm: + - github: + branch-discovery: no-pr + discover-pr-forks-strategy: merge-current + discover-pr-forks-trust: permission + discover-pr-origin: merge-current + discover-tags: false + disable-pr-notifications: true + head-filter-regex: '(main|7\.17|8\.\d+|PR-.*)' + notification-context: 'apm-server-package' + repo: apm-server + repo-owner: elastic + credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken + ssh-checkout: + credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba + build-strategies: + - skip-initial-build: true + - named-branches: + - exact-name: + name: 'main' + case-sensitive: true + - regex-name: + regex: '7\.17' + case-sensitive: true + - regex-name: + regex: '8\.\d+' + case-sensitive: true + - change-request: + ignore-target-only-changes: true + clean: + after: true + before: true + prune: true + shallow-clone: true + depth: 3 + do-not-fetch-tags: true + submodule: + disable: false + recursive: true + parent-credentials: true + timeout: 100 + reference-repo: /var/lib/jenkins/.git-references/apm-server.git + timeout: '15' + use-author: true + wipe-workspace: 'True' diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy new file mode 100644 index 00000000000..5a73626e605 --- /dev/null +++ b/.ci/packaging.groovy @@ -0,0 +1,153 @@ +#!/usr/bin/env groovy +@Library('apm@current') _ + +pipeline { + agent none + environment { + REPO = 'apm-server' + BASE_DIR = "src/github.com/elastic/${env.REPO}" + SLACK_CHANNEL = '#apm-server' + NOTIFY_TO = 'build-apm+apm-server@elastic.co' + JOB_GCS_BUCKET = credentials('gcs-bucket') + JOB_GCS_CREDENTIALS = 'apm-ci-gcs-plugin' + DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod' + DOCKER_REGISTRY = 'docker.elastic.co' + DOCKER_IMAGE = "${env.DOCKER_REGISTRY}/observability-ci/apm-server" + ONLY_DOCS = "false" + } + options { + timeout(time: 2, unit: 'HOURS') + buildDiscarder(logRotator(numToKeepStr: '100', artifactNumToKeepStr: '30', daysToKeepStr: '30')) + timestamps() + ansiColor('xterm') + disableResume() + durabilityHint('PERFORMANCE_OPTIMIZED') + rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true]) + quietPeriod(10) + } + triggers { + issueCommentTrigger('(?i)^\\/package$') + // disable upstream trigger on a PR basis + upstream("apm-server/apm-server-mbp/${ env.JOB_BASE_NAME.startsWith('PR-') ? 'none' : env.JOB_BASE_NAME }") + } + stages { + stage('Filter build') { + agent { label 'ubuntu-18 && immutable' } + when { + beforeAgent true + anyOf { + triggeredBy cause: "IssueCommentCause" + expression { + def ret = isUserTrigger() || isUpstreamTrigger() + if(!ret){ + currentBuild.result = 'NOT_BUILT' + currentBuild.description = "The build has been skipped" + currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" + echo("the build has been skipped due the trigger is a branch scan and the allow ones are manual, GitHub comment, and upstream job") + } + return ret + } + } + } + stage('Checkout') { + environment { + PATH = "${env.PATH}:${env.WORKSPACE}/bin" + HOME = "${env.WORKSPACE}" + } + options { skipDefaultCheckout() } + steps { + pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ]) + deleteDir() + gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true, + shallow: false, reference: "/var/lib/jenkins/.git-references/${REPO}.git") + stash allowEmpty: true, name: 'source', useDefaultExcludes: false + dir("${BASE_DIR}"){ + setEnvVar('ONLY_DOCS', isGitRegionMatch(patterns: [ '.*\\.asciidoc' ], comparator: 'regexp', shouldMatchAll: true)) + } + } + } + stage('Package') { + when { + beforeAgent true + allOf { + expression { return env.ONLY_DOCS == "false" } + anyOf { + branch 'main' + branch pattern: '\\d+\\.\\d+', comparator: 'REGEXP' + expression { return env.GITHUB_COMMENT?.contains('/package')} + } + } + } + options { skipDefaultCheckout() } + environment { + PATH = "${env.PATH}:${env.WORKSPACE}/bin" + HOME = "${env.WORKSPACE}" + SNAPSHOT = "true" + } + matrix { + agent { + label "${PLATFORM}" + } + axes { + axis { + name 'PLATFORM' + values 'linux && immutable', 'arm' + } + } + stages { + stage('Package') { + environment { + PLATFORMS = "${isArm() ? 'linux/arm64' : 'linux/amd64'}" + NEW_TAG = "${isArm() ? env.GIT_BASE_COMMIT + '-arm' : env.GIT_BASE_COMMIT}" + } + steps { + withGithubNotify(context: "Package-${PLATFORM}") { + deleteDir() + unstash 'source' + dir("${BASE_DIR}"){ + withMageEnv(){ + sh(label: 'Build packages', script: './.ci/scripts/package.sh') + dockerLogin(secret: env.DOCKER_SECRET, registry: env.DOCKER_REGISTRY) + sh(label: 'Package & Push', script: "./.ci/scripts/package-docker-snapshot.sh ${NEW_TAG} ${env.DOCKER_IMAGE}") + } + } + } + } + } + stage('DRA') { + when { + beforeAgent true + anyOf { + branch 'main' + branch pattern: '\\d+\\.\\d+', comparator: 'REGEXP' + } + } + steps { + echo 'TBD' + } + } + } + } + post { + failure { + notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") + } + } + } + } + } + post { + cleanup { + notifyBuildResult() + } + } +} + +def notifyStatus(def args = [:]) { + releaseNotification(slackChannel: "${env.SLACK_CHANNEL}", + slackColor: args.slackStatus, + slackCredentialsId: 'jenkins-slack-integration-token', + to: "${env.NOTIFY_TO}", + subject: args.subject, + body: args.body) +} From 4a04d3260bbeef1feaf33d49d473489dbd5c69f5 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 14 Mar 2022 10:53:09 +0000 Subject: [PATCH 02/28] support arm --- .ci/jobs/apm-server-package-mbp.yml | 53 -------------------------- .ci/scripts/package-docker-snapshot.sh | 3 +- 2 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 .ci/jobs/apm-server-package-mbp.yml diff --git a/.ci/jobs/apm-server-package-mbp.yml b/.ci/jobs/apm-server-package-mbp.yml deleted file mode 100644 index 0ea7020db39..00000000000 --- a/.ci/jobs/apm-server-package-mbp.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -- job: - name: apm-server/apm-server-mbp - display-name: APM Server - description: APM Server - project-type: multibranch - concurrent: true - script-path: .ci/packaging.groovy - scm: - - github: - branch-discovery: no-pr - discover-pr-forks-strategy: merge-current - discover-pr-forks-trust: permission - discover-pr-origin: merge-current - discover-tags: false - disable-pr-notifications: true - head-filter-regex: '(main|7\.17|8\.\d+|PR-.*)' - notification-context: 'apm-server-package' - repo: apm-server - repo-owner: elastic - credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken - ssh-checkout: - credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba - build-strategies: - - skip-initial-build: true - - named-branches: - - exact-name: - name: 'main' - case-sensitive: true - - regex-name: - regex: '7\.17' - case-sensitive: true - - regex-name: - regex: '8\.\d+' - case-sensitive: true - - change-request: - ignore-target-only-changes: true - clean: - after: true - before: true - prune: true - shallow-clone: true - depth: 3 - do-not-fetch-tags: true - submodule: - disable: false - recursive: true - parent-credentials: true - timeout: 100 - reference-repo: /var/lib/jenkins/.git-references/apm-server.git - timeout: '15' - use-author: true - wipe-workspace: 'True' diff --git a/.ci/scripts/package-docker-snapshot.sh b/.ci/scripts/package-docker-snapshot.sh index 3ab4253711d..9fbd977437b 100755 --- a/.ci/scripts/package-docker-snapshot.sh +++ b/.ci/scripts/package-docker-snapshot.sh @@ -11,7 +11,8 @@ set -euo pipefail NEW_TAG=${1:?Docker tag is not set} NEW_IMAGE=${2:?Docker image is not set} -export PLATFORMS='linux/amd64' +# linux/amd64 is in the default list already +export PLATFORMS="${PLATFORMS:-+linux/amd64}" export TYPE='docker' export SNAPSHOT='true' export IMAGE="docker.elastic.co/apm/apm-server" From 5cf7081f7ce252d648e817613d707cb748a22c00 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 14:17:32 +0000 Subject: [PATCH 03/28] ci: simplify pipeline --- .ci/packaging.groovy | 88 +++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 5a73626e605..a1cc564a10a 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -10,10 +10,7 @@ pipeline { NOTIFY_TO = 'build-apm+apm-server@elastic.co' JOB_GCS_BUCKET = credentials('gcs-bucket') JOB_GCS_CREDENTIALS = 'apm-ci-gcs-plugin' - DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod' - DOCKER_REGISTRY = 'docker.elastic.co' - DOCKER_IMAGE = "${env.DOCKER_REGISTRY}/observability-ci/apm-server" - ONLY_DOCS = "false" + SNAPSHOT = "true" } options { timeout(time: 2, unit: 'HOURS') @@ -49,6 +46,10 @@ pipeline { } } } + environment { + PATH = "${env.PATH}:${env.WORKSPACE}/bin" + HOME = "${env.WORKSPACE}" + } stage('Checkout') { environment { PATH = "${env.PATH}:${env.WORKSPACE}/bin" @@ -67,23 +68,13 @@ pipeline { } } stage('Package') { - when { - beforeAgent true - allOf { - expression { return env.ONLY_DOCS == "false" } - anyOf { - branch 'main' - branch pattern: '\\d+\\.\\d+', comparator: 'REGEXP' - expression { return env.GITHUB_COMMENT?.contains('/package')} - } - } - } - options { skipDefaultCheckout() } + // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure environment { - PATH = "${env.PATH}:${env.WORKSPACE}/bin" - HOME = "${env.WORKSPACE}" - SNAPSHOT = "true" + URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" + PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" + BUCKET_URI = """${isPR() ? "gs://${JOB_GCS_BUCKET}/pull-requests/pr-${env.CHANGE_ID}" : "gs://${JOB_GCS_BUCKET}/snapshots"}""" } + options { skipDefaultCheckout() } matrix { agent { label "${PLATFORM}" @@ -98,39 +89,50 @@ pipeline { stage('Package') { environment { PLATFORMS = "${isArm() ? 'linux/arm64' : 'linux/amd64'}" - NEW_TAG = "${isArm() ? env.GIT_BASE_COMMIT + '-arm' : env.GIT_BASE_COMMIT}" + PACKAGES = "${isArm() ? 'docker' : ''}" } steps { - withGithubNotify(context: "Package-${PLATFORM}") { - deleteDir() - unstash 'source' - dir("${BASE_DIR}"){ - withMageEnv(){ - sh(label: 'Build packages', script: './.ci/scripts/package.sh') - dockerLogin(secret: env.DOCKER_SECRET, registry: env.DOCKER_REGISTRY) - sh(label: 'Package & Push', script: "./.ci/scripts/package-docker-snapshot.sh ${NEW_TAG} ${env.DOCKER_IMAGE}") - } + deleteDir() + unstash 'source' + dir("${BASE_DIR}"){ + withMageEnv() { + sh(label: 'Build packages', script: './.ci/scripts/package.sh') } } } } - stage('DRA') { - when { - beforeAgent true - anyOf { - branch 'main' - branch pattern: '\\d+\\.\\d+', comparator: 'REGEXP' - } - } + stage('Publish') { steps { - echo 'TBD' + // Copy those files to another location with the sha commit to test them afterward. + googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", + credentialsId: "${JOB_GCS_CREDENTIALS}", + pathPrefix: "${BASE_DIR}/build/distributions/", + pattern: "${BASE_DIR}/build/distributions/**/*", + sharedPublicly: true, + showInline: true) + googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", + credentialsId: "${JOB_GCS_CREDENTIALS}", + pathPrefix: "${BASE_DIR}/build/", + pattern: "${BASE_DIR}/build/dependencies.csv", + sharedPublicly: true, + showInline: true) } } } } - post { - failure { - notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") + } + stage('DRA') { + steps { + googleStorageDownload(bucketUri: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}/*", + credentialsId: "${JOB_GCS_CREDENTIALS}", + localDirectory: "${BASE_DIR}/build/distributions", + pathPrefix: env.PATH_PREFIX) + dir("${BASE_DIR}") { + script { + getVaultSecret.readSecretWrapper { + sh(label: 'release-manager.sh', script: '.ci/scripts/release-manager.sh') + } + } } } } @@ -140,6 +142,10 @@ pipeline { cleanup { notifyBuildResult() } + failure { + echo 'disabled' + // notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") + } } } From a1fa0eb99ba09955c01b64ff4a4a23d091ec3327 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 14:17:59 +0000 Subject: [PATCH 04/28] ci: add release manager script --- .ci/scripts/release-manager.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 .ci/scripts/release-manager.sh diff --git a/.ci/scripts/release-manager.sh b/.ci/scripts/release-manager.sh new file mode 100755 index 00000000000..304c4109be7 --- /dev/null +++ b/.ci/scripts/release-manager.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# This script is executed by the release snapshot stage. +# It requires the below environment variables: +# - BRANCH_NAME +# - VAULT_ADDR +# - VAULT_ROLE_ID +# - VAULT_SECRET_ID +# +set -uexo pipefail + +# set required permissions on artifacts and directory +chmod -R a+r build/distributions/* +chmod -R a+w build/distributions + +# ensure the latest image has been pulled +IMAGE=docker.elastic.co/infra/release-manager:latest +docker pull --quiet $IMAGE + +# Generate checksum files and upload to GCS +docker run --rm \ + --name release-manager \ + -e VAULT_ADDR \ + -e VAULT_ROLE_ID \ + -e VAULT_SECRET_ID \ + --mount type=bind,readonly=false,src="$PWD",target=/artifacts \ + "$IMAGE" \ + cli collect \ + --project apm-server \ + --branch "$BRANCH_NAME" \ + --commit "$(git rev-parse HEAD)" \ + --workflow "snapshot" \ + --artifact-set main From 86c97399c2994cf004ccfdab580b1a1f023ecbeb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 14:19:24 +0000 Subject: [PATCH 05/28] Update .ci/packaging.groovy --- .ci/packaging.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index a1cc564a10a..e3bcab23c1d 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -23,7 +23,6 @@ pipeline { quietPeriod(10) } triggers { - issueCommentTrigger('(?i)^\\/package$') // disable upstream trigger on a PR basis upstream("apm-server/apm-server-mbp/${ env.JOB_BASE_NAME.startsWith('PR-') ? 'none' : env.JOB_BASE_NAME }") } From e5e2c13a2fb275b5d999e9c9b470d047f9c20d33 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 14:19:50 +0000 Subject: [PATCH 06/28] Update .ci/packaging.groovy --- .ci/packaging.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index e3bcab23c1d..d774a635f59 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -58,7 +58,7 @@ pipeline { steps { pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ]) deleteDir() - gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true, + gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false, shallow: false, reference: "/var/lib/jenkins/.git-references/${REPO}.git") stash allowEmpty: true, name: 'source', useDefaultExcludes: false dir("${BASE_DIR}"){ From 8389e2a74f0daa06c42a56ca0b57f1658ba1cd45 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 14:20:05 +0000 Subject: [PATCH 07/28] Update .ci/packaging.groovy --- .ci/packaging.groovy | 3 --- 1 file changed, 3 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index d774a635f59..115b0f82434 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -61,9 +61,6 @@ pipeline { gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false, shallow: false, reference: "/var/lib/jenkins/.git-references/${REPO}.git") stash allowEmpty: true, name: 'source', useDefaultExcludes: false - dir("${BASE_DIR}"){ - setEnvVar('ONLY_DOCS', isGitRegionMatch(patterns: [ '.*\\.asciidoc' ], comparator: 'regexp', shouldMatchAll: true)) - } } } stage('Package') { From 59a4c624e4c058b6e4ab17ea32b488beeb386c8d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 14:59:17 +0000 Subject: [PATCH 08/28] ci: no github command based --- .ci/packaging.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index a1cc564a10a..e3bcab23c1d 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -23,7 +23,6 @@ pipeline { quietPeriod(10) } triggers { - issueCommentTrigger('(?i)^\\/package$') // disable upstream trigger on a PR basis upstream("apm-server/apm-server-mbp/${ env.JOB_BASE_NAME.startsWith('PR-') ? 'none' : env.JOB_BASE_NAME }") } From bd3da2dd22410fc1f242b097ecbc6fa0635c6f2b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 14:59:44 +0000 Subject: [PATCH 09/28] ci: use make release snapshot goal it generates all the required artifacts --- .ci/packaging.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index e3bcab23c1d..3e84541f728 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -87,7 +87,7 @@ pipeline { stages { stage('Package') { environment { - PLATFORMS = "${isArm() ? 'linux/arm64' : 'linux/amd64'}" + PLATFORMS = "${isArm() ? 'linux/arm64' : ''}" PACKAGES = "${isArm() ? 'docker' : ''}" } steps { @@ -95,7 +95,7 @@ pipeline { unstash 'source' dir("${BASE_DIR}"){ withMageEnv() { - sh(label: 'Build packages', script: './.ci/scripts/package.sh') + sh(label: 'Make release-manager-snapshot', script: 'make release-manager-snapshot') } } } From 094c6ff1ca06fd91073f8f453df528fe553758a4 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 16:51:07 +0000 Subject: [PATCH 10/28] ci: docker tar.gz file names to be unified release based --- .ci/scripts/release-manager.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.ci/scripts/release-manager.sh b/.ci/scripts/release-manager.sh index 304c4109be7..79497f1b95c 100755 --- a/.ci/scripts/release-manager.sh +++ b/.ci/scripts/release-manager.sh @@ -13,6 +13,18 @@ set -uexo pipefail chmod -R a+r build/distributions/* chmod -R a+w build/distributions +# rename docker files to support the unified release format. +# TODO: this could be supported by the package system itself +for i in build/distributions/*docker.tar.gz* +do + mv "$i" "${i/linux-arm64.docker.tar.gz/docker-image-arm64.tar.gz}" +done + +for i in build/distributions/*docker.tar.gz* +do + mv "$i" "${i/linux-amd64.docker.tar.gz/docker-image.tar.gz}" +done + # ensure the latest image has been pulled IMAGE=docker.elastic.co/infra/release-manager:latest docker pull --quiet $IMAGE From b43bd25149e7c1222b8e70172eb7022ce706b1f7 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 20:13:41 +0000 Subject: [PATCH 11/28] ci: filter names --- .ci/scripts/release-manager.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/scripts/release-manager.sh b/.ci/scripts/release-manager.sh index 79497f1b95c..43116273f67 100755 --- a/.ci/scripts/release-manager.sh +++ b/.ci/scripts/release-manager.sh @@ -15,12 +15,13 @@ chmod -R a+w build/distributions # rename docker files to support the unified release format. # TODO: this could be supported by the package system itself -for i in build/distributions/*docker.tar.gz* +# or the unified release process the one to do the transformation +for i in build/distributions/*linux-arm64.docker.tar.gz* do mv "$i" "${i/linux-arm64.docker.tar.gz/docker-image-arm64.tar.gz}" done -for i in build/distributions/*docker.tar.gz* +for i in build/distributions/*linux-amd64.docker.tar.gz* do mv "$i" "${i/linux-amd64.docker.tar.gz/docker-image.tar.gz}" done From 15985ea4c084fae0145fb9888301c6ea909d44a2 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 16 Mar 2022 20:34:34 +0000 Subject: [PATCH 12/28] ci: enable notifications --- .ci/packaging.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index a3c8ff8395a..7b1055a7201 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -139,8 +139,7 @@ pipeline { notifyBuildResult() } failure { - echo 'disabled' - // notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") + notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") } } } From 4d47175b0b3eb03b337d71c9150bd40418a0fd74 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 09:50:57 +0000 Subject: [PATCH 13/28] ci: use meta-stages --- .ci/packaging.groovy | 136 ++++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 67 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 7b1055a7201..43a4637c1de 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -49,84 +49,86 @@ pipeline { PATH = "${env.PATH}:${env.WORKSPACE}/bin" HOME = "${env.WORKSPACE}" } - stage('Checkout') { - environment { - PATH = "${env.PATH}:${env.WORKSPACE}/bin" - HOME = "${env.WORKSPACE}" - } - options { skipDefaultCheckout() } - steps { - pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ]) - deleteDir() - gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false, - shallow: false, reference: "/var/lib/jenkins/.git-references/${REPO}.git") - stash allowEmpty: true, name: 'source', useDefaultExcludes: false - } - } - stage('Package') { - // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure - environment { - URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" - PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" - BUCKET_URI = """${isPR() ? "gs://${JOB_GCS_BUCKET}/pull-requests/pr-${env.CHANGE_ID}" : "gs://${JOB_GCS_BUCKET}/snapshots"}""" + stages { + stage('Checkout') { + environment { + PATH = "${env.PATH}:${env.WORKSPACE}/bin" + HOME = "${env.WORKSPACE}" + } + options { skipDefaultCheckout() } + steps { + pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ]) + deleteDir() + gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false, + shallow: false, reference: "/var/lib/jenkins/.git-references/${REPO}.git") + stash allowEmpty: true, name: 'source', useDefaultExcludes: false + } } - options { skipDefaultCheckout() } - matrix { - agent { - label "${PLATFORM}" + stage('Package') { + // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure + environment { + URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" + PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" + BUCKET_URI = """${isPR() ? "gs://${JOB_GCS_BUCKET}/pull-requests/pr-${env.CHANGE_ID}" : "gs://${JOB_GCS_BUCKET}/snapshots"}""" } - axes { - axis { - name 'PLATFORM' - values 'linux && immutable', 'arm' + options { skipDefaultCheckout() } + matrix { + agent { + label "${PLATFORM}" } - } - stages { - stage('Package') { - environment { - PLATFORMS = "${isArm() ? 'linux/arm64' : ''}" - PACKAGES = "${isArm() ? 'docker' : ''}" + axes { + axis { + name 'PLATFORM' + values 'linux && immutable', 'arm' } - steps { - deleteDir() - unstash 'source' - dir("${BASE_DIR}"){ - withMageEnv() { - sh(label: 'Make release-manager-snapshot', script: 'make release-manager-snapshot') + } + stages { + stage('Package') { + environment { + PLATFORMS = "${isArm() ? 'linux/arm64' : ''}" + PACKAGES = "${isArm() ? 'docker' : ''}" + } + steps { + deleteDir() + unstash 'source' + dir("${BASE_DIR}"){ + withMageEnv() { + sh(label: 'Make release-manager-snapshot', script: 'make release-manager-snapshot') + } } } } - } - stage('Publish') { - steps { - // Copy those files to another location with the sha commit to test them afterward. - googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", - credentialsId: "${JOB_GCS_CREDENTIALS}", - pathPrefix: "${BASE_DIR}/build/distributions/", - pattern: "${BASE_DIR}/build/distributions/**/*", - sharedPublicly: true, - showInline: true) - googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", - credentialsId: "${JOB_GCS_CREDENTIALS}", - pathPrefix: "${BASE_DIR}/build/", - pattern: "${BASE_DIR}/build/dependencies.csv", - sharedPublicly: true, - showInline: true) + stage('Publish') { + steps { + // Copy those files to another location with the sha commit to test them afterward. + googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", + credentialsId: "${JOB_GCS_CREDENTIALS}", + pathPrefix: "${BASE_DIR}/build/distributions/", + pattern: "${BASE_DIR}/build/distributions/**/*", + sharedPublicly: true, + showInline: true) + googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", + credentialsId: "${JOB_GCS_CREDENTIALS}", + pathPrefix: "${BASE_DIR}/build/", + pattern: "${BASE_DIR}/build/dependencies.csv", + sharedPublicly: true, + showInline: true) + } } } } } - } - stage('DRA') { - steps { - googleStorageDownload(bucketUri: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}/*", - credentialsId: "${JOB_GCS_CREDENTIALS}", - localDirectory: "${BASE_DIR}/build/distributions", - pathPrefix: env.PATH_PREFIX) - dir("${BASE_DIR}") { - script { - getVaultSecret.readSecretWrapper { - sh(label: 'release-manager.sh', script: '.ci/scripts/release-manager.sh') + stage('DRA') { + steps { + googleStorageDownload(bucketUri: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}/*", + credentialsId: "${JOB_GCS_CREDENTIALS}", + localDirectory: "${BASE_DIR}/build/distributions", + pathPrefix: env.PATH_PREFIX) + dir("${BASE_DIR}") { + script { + getVaultSecret.readSecretWrapper { + sh(label: 'release-manager.sh', script: '.ci/scripts/release-manager.sh') + } } } } From f8c1a0949bd65d2aa21182e0413bc77b5459f5cb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 09:52:03 +0000 Subject: [PATCH 14/28] ci: cosmetic --- .ci/packaging.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 43a4637c1de..ba3f1db5c91 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -93,7 +93,7 @@ pipeline { unstash 'source' dir("${BASE_DIR}"){ withMageEnv() { - sh(label: 'Make release-manager-snapshot', script: 'make release-manager-snapshot') + sh(label: 'make release-manager-snapshot', script: 'make release-manager-snapshot') } } } From e461a46a9a6df6f82d42410fccac49adbbbc9daa Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 09:53:12 +0000 Subject: [PATCH 15/28] chore: testing purposes --- .ci/scripts/release-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/release-manager.sh b/.ci/scripts/release-manager.sh index 43116273f67..bce5c06260b 100755 --- a/.ci/scripts/release-manager.sh +++ b/.ci/scripts/release-manager.sh @@ -40,7 +40,7 @@ docker run --rm \ "$IMAGE" \ cli collect \ --project apm-server \ - --branch "$BRANCH_NAME" \ + --branch "main" \ --commit "$(git rev-parse HEAD)" \ --workflow "snapshot" \ --artifact-set main From acf7debb75ae9c7d45c4ad95ce79e13dc166ee80 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 09:55:55 +0000 Subject: [PATCH 16/28] chore: testing purposes --- .ci/packaging.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index ba3f1db5c91..3130250068a 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -141,7 +141,8 @@ pipeline { notifyBuildResult() } failure { - notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") + echo 'disabled' + //notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") } } } From c6c947e0f593bb7624e1942443b1a0359e258060 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 10:33:06 +0000 Subject: [PATCH 17/28] ci: fix env variables scope and copy dependencies if amd64 --- .ci/packaging.groovy | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 3130250068a..83b762bed4a 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -48,6 +48,9 @@ pipeline { environment { PATH = "${env.PATH}:${env.WORKSPACE}/bin" HOME = "${env.WORKSPACE}" + URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" + // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure + PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" } stages { stage('Checkout') { @@ -65,12 +68,6 @@ pipeline { } } stage('Package') { - // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure - environment { - URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" - PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" - BUCKET_URI = """${isPR() ? "gs://${JOB_GCS_BUCKET}/pull-requests/pr-${env.CHANGE_ID}" : "gs://${JOB_GCS_BUCKET}/snapshots"}""" - } options { skipDefaultCheckout() } matrix { agent { @@ -107,12 +104,15 @@ pipeline { pattern: "${BASE_DIR}/build/distributions/**/*", sharedPublicly: true, showInline: true) - googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", - credentialsId: "${JOB_GCS_CREDENTIALS}", - pathPrefix: "${BASE_DIR}/build/", - pattern: "${BASE_DIR}/build/dependencies.csv", - sharedPublicly: true, - showInline: true) + // Copy the dependencies files if no ARM + whenFalse(isArm()) { + googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${URI_SUFFIX}", + credentialsId: "${JOB_GCS_CREDENTIALS}", + pathPrefix: "${BASE_DIR}/build/", + pattern: "${BASE_DIR}/build/dependencies.csv", + sharedPublicly: true, + showInline: true) + } } } } From 0c99209ccab3f988f3ff89a1e40af420e5098aa9 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 10:34:43 +0000 Subject: [PATCH 18/28] chore: for testing purposes --- .ci/packaging.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 83b762bed4a..eec9ec64ec0 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -48,7 +48,7 @@ pipeline { environment { PATH = "${env.PATH}:${env.WORKSPACE}/bin" HOME = "${env.WORKSPACE}" - URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" + URI_SUFFIX = "commits/acf7debb75ae9c7d45c4ad95ce79e13dc166ee80" // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" } @@ -68,6 +68,10 @@ pipeline { } } stage('Package') { + when { + beforeAgent true + expression { return false } + } options { skipDefaultCheckout() } matrix { agent { From bce8a2d4d8f9bac9eb5b4d07546d6ef7604e504e Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 10:44:38 +0000 Subject: [PATCH 19/28] ci: to be able to pull the release manager docker image --- .ci/packaging.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index eec9ec64ec0..e44a67d2778 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -11,6 +11,8 @@ pipeline { JOB_GCS_BUCKET = credentials('gcs-bucket') JOB_GCS_CREDENTIALS = 'apm-ci-gcs-plugin' SNAPSHOT = "true" + DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod' + DOCKER_REGISTRY = 'docker.elastic.co' } options { timeout(time: 2, unit: 'HOURS') @@ -129,6 +131,7 @@ pipeline { localDirectory: "${BASE_DIR}/build/distributions", pathPrefix: env.PATH_PREFIX) dir("${BASE_DIR}") { + dockerLogin(secret: env.DOCKER_SECRET, registry: env.DOCKER_REGISTRY) script { getVaultSecret.readSecretWrapper { sh(label: 'release-manager.sh', script: '.ci/scripts/release-manager.sh') From 75585b9bf9bf0dd6d54180bb2e836d292c2fa20d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 10:46:09 +0000 Subject: [PATCH 20/28] ci: packer-cache to download release manager image --- .ci/packer_cache.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/packer_cache.sh b/.ci/packer_cache.sh index cf391769265..9962d173d6a 100755 --- a/.ci/packer_cache.sh +++ b/.ci/packer_cache.sh @@ -17,11 +17,12 @@ docker.elastic.co/beats-dev/golang-crossbuild:${GO_VERSION}-main-debian8 docker.elastic.co/beats-dev/golang-crossbuild:${GO_VERSION}-mips docker.elastic.co/beats-dev/golang-crossbuild:${GO_VERSION}-ppc docker.elastic.co/beats-dev/golang-crossbuild:${GO_VERSION}-s390x +docker.elastic.co/infra/release-manager:latest golang:${GO_VERSION} " if [ -x "$(command -v docker)" ]; then for image in ${DOCKER_IMAGES} do - (retry 2 docker pull ${image}) || echo "Error pulling ${image} Docker image, we continue" + (retry 2 docker pull "${image}") || echo "Error pulling ${image} Docker image, we continue" done fi From 415d7fda200e9ab14f4ae5dbd585cbcd248163f9 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 10:53:00 +0000 Subject: [PATCH 21/28] Revert "chore: for testing purposes" This reverts commit 0c99209ccab3f988f3ff89a1e40af420e5098aa9. --- .ci/packaging.groovy | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index e44a67d2778..aa8c301d2db 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -50,7 +50,7 @@ pipeline { environment { PATH = "${env.PATH}:${env.WORKSPACE}/bin" HOME = "${env.WORKSPACE}" - URI_SUFFIX = "commits/acf7debb75ae9c7d45c4ad95ce79e13dc166ee80" + URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" } @@ -70,10 +70,6 @@ pipeline { } } stage('Package') { - when { - beforeAgent true - expression { return false } - } options { skipDefaultCheckout() } matrix { agent { From ec2d59efea30751d129a84f5386b58bec2fff97d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 10:53:43 +0000 Subject: [PATCH 22/28] Revert "chore: testing purposes" This reverts commit acf7debb75ae9c7d45c4ad95ce79e13dc166ee80. --- .ci/packaging.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index aa8c301d2db..0c750cdb809 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -144,8 +144,7 @@ pipeline { notifyBuildResult() } failure { - echo 'disabled' - //notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") + notifyStatus(slackStatus: 'danger', subject: "[${env.REPO}] DRA failed", body: "Build: (<${env.RUN_DISPLAY_URL}|here>)") } } } From 779c26f17a924d6dc723cec2805b52e345f2ae35 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 11:54:48 +0000 Subject: [PATCH 23/28] ci: set global variables after the gitCheckout since GIT_BASE_COMMIT is not available earlier --- .ci/packaging.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 0c750cdb809..c2f5be3b080 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -50,9 +50,6 @@ pipeline { environment { PATH = "${env.PATH}:${env.WORKSPACE}/bin" HOME = "${env.WORKSPACE}" - URI_SUFFIX = "commits/${env.GIT_BASE_COMMIT}" - // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure - PATH_PREFIX = "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}" } stages { stage('Checkout') { @@ -67,6 +64,11 @@ pipeline { gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false, shallow: false, reference: "/var/lib/jenkins/.git-references/${REPO}.git") stash allowEmpty: true, name: 'source', useDefaultExcludes: false + // set environment variables globally since they are used afterwards but GIT_BASE_COMMIT won't + // be available until gitCheckout is executed. + setEnvVar('URI_SUFFIX', "commits/${env.GIT_BASE_COMMIT}") + // JOB_GCS_BUCKET contains the bucket and some folders, let's build the folder structure + setEnvVar('PATH_PREFIX', "${JOB_GCS_BUCKET.contains('/') ? JOB_GCS_BUCKET.substring(JOB_GCS_BUCKET.indexOf('/') + 1) + '/' + env.URI_SUFFIX : env.URI_SUFFIX}") } } stage('Package') { From a9c34a8fab4e4ce8365c9c80b2f5b898603f9d09 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 11:58:16 +0000 Subject: [PATCH 24/28] Revert "chore: testing purposes" This reverts commit e461a46a9a6df6f82d42410fccac49adbbbc9daa. --- .ci/scripts/release-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/release-manager.sh b/.ci/scripts/release-manager.sh index bce5c06260b..43116273f67 100755 --- a/.ci/scripts/release-manager.sh +++ b/.ci/scripts/release-manager.sh @@ -40,7 +40,7 @@ docker run --rm \ "$IMAGE" \ cli collect \ --project apm-server \ - --branch "main" \ + --branch "$BRANCH_NAME" \ --commit "$(git rev-parse HEAD)" \ --workflow "snapshot" \ --artifact-set main From 7a87a44ecde57a2741efde8b215a542b1e286bee Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 16:09:31 +0000 Subject: [PATCH 25/28] Update .ci/packaging.groovy Co-authored-by: Ivan Fernandez Calvo --- .ci/packaging.groovy | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index c2f5be3b080..7afafe496cf 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -53,10 +53,6 @@ pipeline { } stages { stage('Checkout') { - environment { - PATH = "${env.PATH}:${env.WORKSPACE}/bin" - HOME = "${env.WORKSPACE}" - } options { skipDefaultCheckout() } steps { pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ]) From 162e9ffcf36715f8961da9b8de00d10b20ff8b61 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 17 Mar 2022 16:11:04 +0000 Subject: [PATCH 26/28] Update .ci/scripts/package-docker-snapshot.sh --- .ci/scripts/package-docker-snapshot.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/scripts/package-docker-snapshot.sh b/.ci/scripts/package-docker-snapshot.sh index 9fbd977437b..3ab4253711d 100755 --- a/.ci/scripts/package-docker-snapshot.sh +++ b/.ci/scripts/package-docker-snapshot.sh @@ -11,8 +11,7 @@ set -euo pipefail NEW_TAG=${1:?Docker tag is not set} NEW_IMAGE=${2:?Docker image is not set} -# linux/amd64 is in the default list already -export PLATFORMS="${PLATFORMS:-+linux/amd64}" +export PLATFORMS='linux/amd64' export TYPE='docker' export SNAPSHOT='true' export IMAGE="docker.elastic.co/apm/apm-server" From 787958633faed72bda193678fe49b64bd36ffc99 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 18 Mar 2022 08:35:48 +0000 Subject: [PATCH 27/28] Update .ci/scripts/release-manager.sh Co-authored-by: Andrew Wilkins --- .ci/scripts/release-manager.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.ci/scripts/release-manager.sh b/.ci/scripts/release-manager.sh index 43116273f67..e5b86248f92 100755 --- a/.ci/scripts/release-manager.sh +++ b/.ci/scripts/release-manager.sh @@ -13,6 +13,11 @@ set -uexo pipefail chmod -R a+r build/distributions/* chmod -R a+w build/distributions +# rename dependencies.csv to the name expected by release-manager. +VERSION=$(make get-version) +mv build/distributions/dependencies.csv \ + build/distributions/dependencies-$VERSION.csv + # rename docker files to support the unified release format. # TODO: this could be supported by the package system itself # or the unified release process the one to do the transformation From b150e2f840eedec06d6ab25cb90ab5494ee43d18 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 18 Mar 2022 08:50:28 +0000 Subject: [PATCH 28/28] Update .ci/packaging.groovy Co-authored-by: Mike Place --- .ci/packaging.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 7afafe496cf..53d068fd272 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -41,7 +41,7 @@ pipeline { currentBuild.result = 'NOT_BUILT' currentBuild.description = "The build has been skipped" currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" - echo("the build has been skipped due the trigger is a branch scan and the allow ones are manual, GitHub comment, and upstream job") + echo("the build has been skipped due the trigger is a branch scan and the allowed ones are manual, GitHub comment, and upstream job") } return ret }