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([
16
16
17
17
env.BASHBREW_ARCH = env.JOB_NAME.split('/')[-1].minus('deploy-') // "windows-amd64", "arm64v8", etc
18
18
19
- node('multiarch-' + env.BASHBREW_ARCH ) { ansiColor('xterm') {
19
+ node('put-shared' ) { ansiColor('xterm') {
20
20
stage('Checkout') {
21
21
checkout(scmGit(
22
22
userRemoteConfigs: [[
@@ -37,6 +37,25 @@ node('multiarch-' + env.BASHBREW_ARCH) { ansiColor('xterm') {
37
37
))
38
38
}
39
39
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
+
40
59
dir('meta') {
41
60
stage('Generate') {
42
61
sh '''#!/usr/bin/env bash
@@ -70,4 +89,7 @@ node('multiarch-' + env.BASHBREW_ARCH) { ansiColor('xterm') {
70
89
}
71
90
}
72
91
}
92
+
93
+ // "docker logout"
94
+ dir(env.DOCKER_CONFIG) { deleteDir() }
73
95
} }
You can’t perform that action at this time.
0 commit comments