From 78131c1028f0e2de780757896932aa14ad212eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 9 May 2023 17:45:09 +0200 Subject: [PATCH] ci: add Alchemy and Infura credentials in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depends on: https://github.com/status-im/status-jenkins-lib/pull/64 Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.android | 2 +- ci/Jenkinsfile.combined | 2 +- ci/Jenkinsfile.ios | 2 +- ci/Jenkinsfile.nix-cache | 2 +- ci/Jenkinsfile.tests | 2 +- ci/tests/Jenkinsfile.e2e-nightly | 2 +- ci/tests/Jenkinsfile.e2e-prs | 2 +- ci/tests/Jenkinsfile.e2e-upgrade | 2 +- ci/tools/Jenkinsfile.fastlane-clean | 2 +- ci/tools/Jenkinsfile.playstore-meta | 2 +- ci/tools/Jenkinsfile.xcode-clean | 2 +- scripts/build-android.sh | 17 +++++++++++++++-- 12 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index 29b9393d6e..c22d5ecdc0 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' /* Options section can't access functions in objects. */ def isPRBuild = utils.isPRBuild() diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index df9a2fa9c7..5291da9d35 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { agent { label 'linux' } diff --git a/ci/Jenkinsfile.ios b/ci/Jenkinsfile.ios index 2d71306f59..9064ce3855 100644 --- a/ci/Jenkinsfile.ios +++ b/ci/Jenkinsfile.ios @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' /* Options section can't access functions in objects. */ def isPRBuild = utils.isPRBuild() diff --git a/ci/Jenkinsfile.nix-cache b/ci/Jenkinsfile.nix-cache index 2d60863f8d..36521a81f9 100644 --- a/ci/Jenkinsfile.nix-cache +++ b/ci/Jenkinsfile.nix-cache @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { agent { label params.AGENT_LABEL } diff --git a/ci/Jenkinsfile.tests b/ci/Jenkinsfile.tests index 4cc82d8b27..fa80553346 100644 --- a/ci/Jenkinsfile.tests +++ b/ci/Jenkinsfile.tests @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' /* Options section can't access functions in objects. */ def isPRBuild = utils.isPRBuild() diff --git a/ci/tests/Jenkinsfile.e2e-nightly b/ci/tests/Jenkinsfile.e2e-nightly index 18f675cd0d..a22df4c14c 100644 --- a/ci/tests/Jenkinsfile.e2e-nightly +++ b/ci/tests/Jenkinsfile.e2e-nightly @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { diff --git a/ci/tests/Jenkinsfile.e2e-prs b/ci/tests/Jenkinsfile.e2e-prs index 897eecb71e..b07d6467fe 100644 --- a/ci/tests/Jenkinsfile.e2e-prs +++ b/ci/tests/Jenkinsfile.e2e-prs @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { diff --git a/ci/tests/Jenkinsfile.e2e-upgrade b/ci/tests/Jenkinsfile.e2e-upgrade index e95759a090..9121423355 100644 --- a/ci/tests/Jenkinsfile.e2e-upgrade +++ b/ci/tests/Jenkinsfile.e2e-upgrade @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { diff --git a/ci/tools/Jenkinsfile.fastlane-clean b/ci/tools/Jenkinsfile.fastlane-clean index 029daf9704..822e02c757 100644 --- a/ci/tools/Jenkinsfile.fastlane-clean +++ b/ci/tools/Jenkinsfile.fastlane-clean @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { agent { label 'macos' } diff --git a/ci/tools/Jenkinsfile.playstore-meta b/ci/tools/Jenkinsfile.playstore-meta index 2a3ac7315b..55371d55d6 100644 --- a/ci/tools/Jenkinsfile.playstore-meta +++ b/ci/tools/Jenkinsfile.playstore-meta @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { agent { label 'linux' } diff --git a/ci/tools/Jenkinsfile.xcode-clean b/ci/tools/Jenkinsfile.xcode-clean index 36c46e8c53..e457105266 100644 --- a/ci/tools/Jenkinsfile.xcode-clean +++ b/ci/tools/Jenkinsfile.xcode-clean @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.7.2' +library 'status-jenkins-lib@v1.7.3' pipeline { agent { diff --git a/scripts/build-android.sh b/scripts/build-android.sh index 7d5623ced7..fdbe7edc1a 100755 --- a/scripts/build-android.sh +++ b/scripts/build-android.sh @@ -39,9 +39,22 @@ chmod 644 ${SECRETS_FILE_PATH} # If secrets file was created we want to remove it. trap "rm -vf ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT +# Names of variables containing secrets to save in env file. +SECRETS_ENV_VARS=( + 'ALCHEMY_ARBITRUM_GOERLI_TOKEN' + 'ALCHEMY_ARBITRUM_MAINNET_TOKEN' + 'ALCHEMY_OPTIMISM_GOERLI_TOKEN' + 'ALCHEMY_OPTIMISM_MAINNET_TOKEN' + 'INFURA_TOKEN' + 'INFURA_TOKEN_SECRET' + 'OPENSEA_API_KEY' + 'POKT_TOKEN' +) + # Secrets like this can't be passed via args or they end up in derivation. -if [[ -n "${POKT_TOKEN}" ]]; then append_env_export 'POKT_TOKEN'; fi -if [[ -n "${OPENSEA_API_KEY}" ]]; then append_env_export 'OPENSEA_API_KEY'; fi +for SECRET_VAR_NAME in "${SECRETS_ENV_VARS[@]}"; do + [[ -n "${!SECRET_VAR_NAME}" ]] && append_env_export "${SECRET_VAR_NAME}" +done # If no secrets were passed there's no need to pass the 'secretsFile'. if [[ -s "${SECRETS_FILE_PATH}" ]]; then