File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ properties([
1616
1717env.BASHBREW_ARCH = env.JOB_NAME.split('/')[-1].minus('deploy-') // "windows-amd64", "arm64v8", etc
1818
19- node('multiarch-' + env.BASHBREW_ARCH ) { ansiColor('xterm') {
19+ node('put-shared' ) { ansiColor('xterm') {
2020 stage('Checkout') {
2121 checkout(scmGit(
2222 userRemoteConfigs: [[
@@ -37,6 +37,25 @@ node('multiarch-' + env.BASHBREW_ARCH) { ansiColor('xterm') {
3737 ))
3838 }
3939
40+ // make sure "docker login" is localized to this workspace
41+ env.DOCKER_CONFIG = workspace + '/.docker'
42+ dir(env.DOCKER_CONFIG) { deleteDir() }
43+
44+ stage('Login') {
45+ withCredentials([
46+ usernamePassword(
47+ credentialsId: 'docker-hub-' + env.BASHBREW_ARCH,
48+ usernameVariable: 'DOCKER_USERNAME',
49+ passwordVariable: 'DOCKER_PASSWORD',
50+ ),
51+ ]) {
52+ sh '''#!/usr/bin/env bash
53+ set -Eeuo pipefail # no -x
54+ docker login --username "$DOCKER_USERNAME" --password-stdin <<<"$DOCKER_PASSWORD"
55+ '''
56+ }
57+ }
58+
4059 dir('meta') {
4160 stage('Generate') {
4261 sh '''#!/usr/bin/env bash
@@ -70,4 +89,7 @@ node('multiarch-' + env.BASHBREW_ARCH) { ansiColor('xterm') {
7089 }
7190 }
7291 }
92+
93+ // "docker logout"
94+ dir(env.DOCKER_CONFIG) { deleteDir() }
7395} }
You can’t perform that action at this time.
0 commit comments