From 8dd75fb9e0ca7e24dfeb94cb3211c163d4c9471d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 24 May 2022 10:17:45 +0100 Subject: [PATCH 1/3] chore: for testing purposes --- .ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 4ce959627e..364c91d865 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -1,6 +1,6 @@ #!/usr/bin/env groovy -@Library('apm@current') _ +@Library('apm@test/read-secret-vault') _ pipeline { agent { label 'ubuntu-20 && immutable' } From 7326df72410c20a46cd959aecbf09f320cd31030 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 24 May 2022 10:19:30 +0100 Subject: [PATCH 2/3] ci: use withSecretVault --- .ci/Jenkinsfile | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 364c91d865..b17e36ed54 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -279,18 +279,6 @@ def withKubernetes(Closure body) { def withCloudTestEnv(Closure body) { def maskedVars = [] - // AWS - def aws = getVaultSecret(secret: "${AWS_ACCOUNT_SECRET}").data - if (!aws.containsKey('access_key')) { - error("${AWS_ACCOUNT_SECRET} doesn't contain 'access_key'") - } - if (!aws.containsKey('secret_key')) { - error("${AWS_ACCOUNT_SECRET} doesn't contain 'secret_key'") - } - maskedVars.addAll([ - [var: "AWS_ACCESS_KEY_ID", password: aws.access_key], - [var: "AWS_SECRET_ACCESS_KEY", password: aws.secret_key], - ]) // GCP withGCPEnv(secret: env.ELASTIC_PACKAGE_GCP_SECRET) { maskedVars.add([var: 'GOOGLE_CREDENTIALS', password: readFile(file: env.GOOGLE_APPLICATION_CREDENTIALS)]); @@ -298,7 +286,10 @@ def withCloudTestEnv(Closure body) { } // Masking withEnvMask(vars: maskedVars) { - body() + withSecretVault(secret: "${AWS_ACCOUNT_SECRET}", + data: ['access_key': 'AWS_ACCESS_KEY_ID', 'secret_key': 'AWS_SECRET_ACCESS_KEY']) { + body() + } } } From d8a90db6e99a57152f40751c40cc76253f42613d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Wed, 25 May 2022 18:02:05 +0100 Subject: [PATCH 3/3] Update .ci/Jenkinsfile --- .ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index b17e36ed54..14cbc46648 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -1,6 +1,6 @@ #!/usr/bin/env groovy -@Library('apm@test/read-secret-vault') _ +@Library('apm@current') _ pipeline { agent { label 'ubuntu-20 && immutable' }