From 2b113543a9450623b72d925cd319db52c9b8f3f6 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 15 Feb 2021 20:19:58 +0000 Subject: [PATCH 1/6] [CI] use branch for testing purposes --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3cee434b6e6..fac8648a29a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ #!/usr/bin/env groovy -@Library('apm@current') _ +@Library('apm@feature/override-google-storage-step') _ pipeline { agent { label 'ubuntu-18 && immutable' } From f01f7b284d76b1098513b8ce3b6b014b986898a5 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 15 Feb 2021 20:24:24 +0000 Subject: [PATCH 2/6] [CI] googleStorageUploadExt step --- Jenkinsfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fac8648a29a..c58789b1c53 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -311,13 +311,10 @@ def publishPackages(beatsFolder){ * @param beatsFolder the beats folder. */ def uploadPackages(bucketUri, beatsFolder){ - googleStorageUpload(bucket: bucketUri, + googleStorageUploadExt(bucket: bucket: bucketUri, credentialsId: "${JOB_GCS_CREDENTIALS}", - pathPrefix: "${beatsFolder}/build/distributions/", pattern: "${beatsFolder}/build/distributions/**/*", - sharedPublicly: true, - showInline: true - ) + sharedPublicly: true) } /** @@ -693,11 +690,10 @@ def archiveTestOutput(Map args = [:]) { */ def tarAndUploadArtifacts(Map args = [:]) { tar(file: args.file, dir: args.location, archive: false, allowMissing: true) - googleStorageUpload(bucket: "gs://${JOB_GCS_BUCKET}/${env.JOB_NAME}-${env.BUILD_ID}", - credentialsId: "${JOB_GCS_CREDENTIALS}", - pattern: "${args.file}", - sharedPublicly: true, - showInline: true) + googleStorageUploadExt(bucket: "gs://${JOB_GCS_BUCKET}/${env.JOB_NAME}-${env.BUILD_ID}", + credentialsId: "${JOB_GCS_CREDENTIALS}", + pattern: "${args.file}", + sharedPublicly: true) } /** From 9a38cb854f7fe131a6e983a59e0974052abf5074 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 15 Feb 2021 20:29:01 +0000 Subject: [PATCH 3/6] [CI] googleStorageUploadExt step --- .ci/packaging.groovy | 11 ++++------- Jenkinsfile | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 325084ef181..64029a11bce 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -448,14 +448,11 @@ def publishPackages(baseDir){ uploadPackages("${bucketUri}/${beatsFolderName}", baseDir) } -def uploadPackages(bucketUri, baseDir){ - googleStorageUpload(bucket: bucketUri, +def uploadPackages(bucketUri, beatsFolder){ + googleStorageUploadExt(bucket: bucketUri, credentialsId: "${JOB_GCS_CREDENTIALS}", - pathPrefix: "${baseDir}/build/distributions/", - pattern: "${baseDir}/build/distributions/**/*", - sharedPublicly: true, - showInline: true - ) + pattern: "${beatsFolder}/build/distributions/**/*", + sharedPublicly: true) } /** diff --git a/Jenkinsfile b/Jenkinsfile index c58789b1c53..e776a765d86 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -311,7 +311,7 @@ def publishPackages(beatsFolder){ * @param beatsFolder the beats folder. */ def uploadPackages(bucketUri, beatsFolder){ - googleStorageUploadExt(bucket: bucket: bucketUri, + googleStorageUploadExt(bucket: bucketUri, credentialsId: "${JOB_GCS_CREDENTIALS}", pattern: "${beatsFolder}/build/distributions/**/*", sharedPublicly: true) From 2d1ce8e3fe20fb511fb3694a5617faf90d99317b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 15 Feb 2021 20:29:25 +0000 Subject: [PATCH 4/6] [CI] use branch for testing purposes --- .ci/packaging.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 64029a11bce..0cc1110e084 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -1,6 +1,6 @@ #!/usr/bin/env groovy -@Library('apm@current') _ +@Library('apm@feature/override-google-storage-step') _ import groovy.transform.Field From 268a89f02d5b8f5360679341ea34216050cd9678 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 15 Feb 2021 21:35:29 +0000 Subject: [PATCH 5/6] Use a new credentials --- .ci/packaging.groovy | 3 ++- Jenkinsfile | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 0cc1110e084..4df1b5a4cbc 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -17,6 +17,7 @@ pipeline { JOB_GCS_BUCKET = 'beats-ci-artifacts' JOB_GCS_BUCKET_STASH = 'beats-ci-temp' JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin' + JOB_GCS_EXT_CREDENTIALS = 'beats-ci-gcs-plugin-file-credentials' DOCKERELASTIC_SECRET = 'secret/observability-team/ci/docker-registry/prod' DOCKER_REGISTRY = 'docker.elastic.co' GITHUB_CHECK_E2E_TESTS_NAME = 'E2E Tests' @@ -450,7 +451,7 @@ def publishPackages(baseDir){ def uploadPackages(bucketUri, beatsFolder){ googleStorageUploadExt(bucket: bucketUri, - credentialsId: "${JOB_GCS_CREDENTIALS}", + credentialsId: "${JOB_GCS_EXT_CREDENTIALS}", pattern: "${beatsFolder}/build/distributions/**/*", sharedPublicly: true) } diff --git a/Jenkinsfile b/Jenkinsfile index e776a765d86..55405b8cff3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,6 +14,7 @@ pipeline { DOCKER_REGISTRY = 'docker.elastic.co' JOB_GCS_BUCKET = 'beats-ci-temp' JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin' + JOB_GCS_EXT_CREDENTIALS = 'beats-ci-gcs-plugin-file-credentials' OSS_MODULE_PATTERN = '^[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*' PIPELINE_LOG_LEVEL = 'INFO' PYTEST_ADDOPTS = "${params.PYTEST_ADDOPTS}" @@ -312,7 +313,7 @@ def publishPackages(beatsFolder){ */ def uploadPackages(bucketUri, beatsFolder){ googleStorageUploadExt(bucket: bucketUri, - credentialsId: "${JOB_GCS_CREDENTIALS}", + credentialsId: "${JOB_GCS_EXT_CREDENTIALS}", pattern: "${beatsFolder}/build/distributions/**/*", sharedPublicly: true) } @@ -691,7 +692,7 @@ def archiveTestOutput(Map args = [:]) { def tarAndUploadArtifacts(Map args = [:]) { tar(file: args.file, dir: args.location, archive: false, allowMissing: true) googleStorageUploadExt(bucket: "gs://${JOB_GCS_BUCKET}/${env.JOB_NAME}-${env.BUILD_ID}", - credentialsId: "${JOB_GCS_CREDENTIALS}", + credentialsId: "${JOB_GCS_EXT_CREDENTIALS}", pattern: "${args.file}", sharedPublicly: true) } From 838d9a960939fa6c30778b348aaf2499c668337a Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 16 Feb 2021 10:14:20 +0000 Subject: [PATCH 6/6] Apply suggestions from code review --- .ci/packaging.groovy | 4 ++-- Jenkinsfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 4df1b5a4cbc..b90182a5d00 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -1,6 +1,6 @@ #!/usr/bin/env groovy -@Library('apm@feature/override-google-storage-step') _ +@Library('apm@current') _ import groovy.transform.Field @@ -508,4 +508,4 @@ def fixPermissions() { } } } -} \ No newline at end of file +} diff --git a/Jenkinsfile b/Jenkinsfile index 55405b8cff3..8e8d67c782b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ #!/usr/bin/env groovy -@Library('apm@feature/override-google-storage-step') _ +@Library('apm@current') _ pipeline { agent { label 'ubuntu-18 && immutable' }