diff --git a/Jenkinsfile b/Jenkinsfile index 0f2aa39623..a96c2e248a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,6 +92,7 @@ pipeline { } steps { script { + dockerLogin(params) try { sh './docker/env/hydra.sh pre-commit' // also check the commit-messge for the rules we want @@ -170,6 +171,8 @@ pipeline { dir('scylla-cluster-tests') { checkout scm + dockerLogin(params) + wrap([$class: 'BuildUser']) { echo "calling createSctRunner" timeout(time: 5, unit: 'MINUTES') { @@ -214,6 +217,7 @@ pipeline { dir(working_dir) { checkout scm } + dockerLogin(params) if (sct_runner_backends.contains(backend)){ try { wrap([$class: 'BuildUser']) { diff --git a/vars/artifactsPipeline.groovy b/vars/artifactsPipeline.groovy index 1426c45bc8..11e3e7abcd 100644 --- a/vars/artifactsPipeline.groovy +++ b/vars/artifactsPipeline.groovy @@ -136,6 +136,7 @@ def call(Map pipelineParams) { checkout scm } } + dockerLogin(params) } stage('Create Argus Test Run') { catchError(stageResult: 'FAILURE') { diff --git a/vars/byoLongevityPipeline.groovy b/vars/byoLongevityPipeline.groovy index 1feee9e000..5264ce0cf5 100644 --- a/vars/byoLongevityPipeline.groovy +++ b/vars/byoLongevityPipeline.groovy @@ -134,6 +134,7 @@ def call() { checkoutQaInternal(params) } + dockerLogin(params) } } stage('Create SCT Runner') { diff --git a/vars/dockerLogin.groovy b/vars/dockerLogin.groovy new file mode 100644 index 0000000000..f3a21cec2c --- /dev/null +++ b/vars/dockerLogin.groovy @@ -0,0 +1,10 @@ +#!groovy + +def call(Map params = [:]) { + withCredentials([ + string(credentialsId: 'docker-hub-jenkins-user', variable: 'DOCKER_USERNAME'), + string(credentialsId: 'docker-hub-api-key', variable: 'DOCKER_PASSWORD') + ]) { + sh 'docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD' + } +} diff --git a/vars/jepsenPipeline.groovy b/vars/jepsenPipeline.groovy index 751f32e584..e2d925e2e5 100644 --- a/vars/jepsenPipeline.groovy +++ b/vars/jepsenPipeline.groovy @@ -114,6 +114,7 @@ def call(Map pipelineParams) { checkoutQaInternal(params) } } + dockerLogin(params) } } stage('Create Argus Test Run') { diff --git a/vars/longevityPipeline.groovy b/vars/longevityPipeline.groovy index e94fc783dd..ad8ed2910f 100644 --- a/vars/longevityPipeline.groovy +++ b/vars/longevityPipeline.groovy @@ -215,6 +215,7 @@ def call(Map pipelineParams) { checkoutQaInternal(params) } } + dockerLogin(params) } } stage('Create Argus Test Run') { diff --git a/vars/managerPipeline.groovy b/vars/managerPipeline.groovy index 833ec3c56b..5cfefdfd64 100644 --- a/vars/managerPipeline.groovy +++ b/vars/managerPipeline.groovy @@ -194,6 +194,7 @@ def call(Map pipelineParams) { checkout scm checkoutQaInternal(params) } + dockerLogin(params) } } stage('Create Argus Test Run') { diff --git a/vars/perfRegressionParallelPipeline.groovy b/vars/perfRegressionParallelPipeline.groovy index eaa0ded778..901eb7f563 100644 --- a/vars/perfRegressionParallelPipeline.groovy +++ b/vars/perfRegressionParallelPipeline.groovy @@ -175,6 +175,7 @@ def call(Map pipelineParams) { loadEnvFromString(params.extra_environment_variables) dir('scylla-cluster-tests') { checkout scm + dockerLogin(params) (testDuration, testRunTimeout, runnerTimeout, collectLogsTimeout, resourceCleanupTimeout) = getJobTimeouts(params, builder.region) base_versions_list = params.base_versions.contains('.') ? params.base_versions.split('\\,') : [] def new_repo = params.new_scylla_repo @@ -265,6 +266,7 @@ def call(Map pipelineParams) { dir('scylla-cluster-tests') { checkout scm } + dockerLogin(params) } } } diff --git a/vars/perfSearchBestConfigParallelPipeline.groovy b/vars/perfSearchBestConfigParallelPipeline.groovy index 385adb7a62..6c54b61159 100644 --- a/vars/perfSearchBestConfigParallelPipeline.groovy +++ b/vars/perfSearchBestConfigParallelPipeline.groovy @@ -154,6 +154,7 @@ def call(Map pipelineParams) { wrap([$class: 'BuildUser']) { dir('scylla-cluster-tests') { checkout scm + dockerLogin(params) (testDuration, testRunTimeout, runnerTimeout, collectLogsTimeout, resourceCleanupTimeout) = getJobTimeouts(params, builder.region) } } diff --git a/vars/rollingOperatorUpgradePipeline.groovy b/vars/rollingOperatorUpgradePipeline.groovy index 86986bc48d..c4521c0212 100644 --- a/vars/rollingOperatorUpgradePipeline.groovy +++ b/vars/rollingOperatorUpgradePipeline.groovy @@ -119,6 +119,7 @@ def call(Map pipelineParams) { wrap([$class: 'BuildUser']) { dir('scylla-cluster-tests') { checkout scm + dockerLogin(params) (testDuration, testRunTimeout, runnerTimeout, collectLogsTimeout, resourceCleanupTimeout) = getJobTimeouts(params, builder.region) } } diff --git a/vars/rollingUpgradePipeline.groovy b/vars/rollingUpgradePipeline.groovy index f308a3e3b9..cc571416dd 100644 --- a/vars/rollingUpgradePipeline.groovy +++ b/vars/rollingUpgradePipeline.groovy @@ -131,6 +131,7 @@ def call(Map pipelineParams) { dir('scylla-cluster-tests') { checkout scm checkoutQaInternal(params) + dockerLogin(params) ArrayList base_versions_list = params.base_versions.contains('.') ? params.base_versions.split('\\,') : [] supportedVersions = supportedUpgradeFromVersions( @@ -175,6 +176,7 @@ def call(Map pipelineParams) { checkoutQaInternal(params) } } + dockerLogin(params) } } }