@@ -84,65 +84,67 @@ node('multiarch-' + env.BASHBREW_ARCH) { ansiColor('xterm') {
84
84
return
85
85
}
86
86
87
- /*
88
- // TODO this is currently already done on the worker machines themselves, which is a tradeoff
89
- // make sure "docker login" is localized to this workspace
90
- env.DOCKER_CONFIG = workspace + '/.docker'
91
- dir(env.DOCKER_CONFIG) { deleteDir() }
92
-
93
- withCredentials([usernamePassword(
94
- credentialsId: 'docker-hub-' + env.BASHBREW_ARCH, // TODO windows?
95
- usernameVariable: 'DOCKER_USERNAME',
96
- passwordVariable: 'DOCKER_PASSWORD',
97
- )]) {
98
- sh '''#!/usr/bin/env bash
99
- set -Eeuo pipefail
100
- docker login --username "$DOCKER_USERNAME" --password-stdin <<<"$DOCKER_PASSWORD"
101
- '''
102
- }
103
- */
104
-
105
- def buildEnvs = []
106
- stage('Prep') {
107
- if (obj.commands.build.contains(' buildx ')) {
108
- def json = sh(returnStdout: true, script: '''#!/usr/bin/env bash
109
- set -Eeuo pipefail -x
110
-
111
- .doi/.bin/bashbrew-buildkit-env-setup.sh \\
112
- | jq 'to_entries | map(.key + "=" + .value)'
113
- ''').trim()
114
- if (json) {
115
- buildEnvs += readJSON(text: json)
116
- }
87
+ timeout(time: 3, unit: 'HOURS') {
88
+ /*
89
+ // TODO this is currently already done on the worker machines themselves, which is a tradeoff
90
+ // make sure "docker login" is localized to this workspace
91
+ env.DOCKER_CONFIG = workspace + '/.docker'
92
+ dir(env.DOCKER_CONFIG) { deleteDir() }
93
+
94
+ withCredentials([usernamePassword(
95
+ credentialsId: 'docker-hub-' + env.BASHBREW_ARCH, // TODO windows?
96
+ usernameVariable: 'DOCKER_USERNAME',
97
+ passwordVariable: 'DOCKER_PASSWORD',
98
+ )]) {
99
+ sh '''#!/usr/bin/env bash
100
+ set -Eeuo pipefail
101
+ docker login --username "$DOCKER_USERNAME" --password-stdin <<<"$DOCKER_PASSWORD"
102
+ '''
117
103
}
118
- }
119
-
120
- withEnv(buildEnvs) {
121
- dir('build') {
122
- deleteDir()
104
+ */
123
105
124
- stage('Pull') {
125
- sh """#!/usr/bin/env bash
106
+ def buildEnvs = []
107
+ stage('Prep') {
108
+ if (obj.commands.build.contains(' buildx ')) {
109
+ def json = sh(returnStdout: true, script: '''#!/usr/bin/env bash
126
110
set -Eeuo pipefail -x
127
111
128
- ${ obj.commands.pull }
129
- """
112
+ .doi/.bin/bashbrew-buildkit-env-setup.sh \\
113
+ | jq 'to_entries | map(.key + "=" + .value)'
114
+ ''').trim()
115
+ if (json) {
116
+ buildEnvs += readJSON(text: json)
117
+ }
130
118
}
119
+ }
131
120
132
- stage('Build' ) {
133
- sh """#!/usr/bin/env bash
134
- set -Eeuo pipefail -x
121
+ withEnv(buildEnvs ) {
122
+ dir('build') {
123
+ deleteDir()
135
124
136
- ${ obj.commands.build }
137
- """
138
- }
125
+ stage('Pull') {
126
+ sh """#!/usr/bin/env bash
127
+ set -Eeuo pipefail -x
139
128
140
- stage('Push') {
141
- sh """#!/usr/bin/env bash
142
- set -Eeuo pipefail -x
129
+ ${ obj.commands.pull }
130
+ """
131
+ }
132
+
133
+ stage('Build') {
134
+ sh """#!/usr/bin/env bash
135
+ set -Eeuo pipefail -x
136
+
137
+ ${ obj.commands.build }
138
+ """
139
+ }
140
+
141
+ stage('Push') {
142
+ sh """#!/usr/bin/env bash
143
+ set -Eeuo pipefail -x
143
144
144
- ${ obj.commands.push }
145
- """
145
+ ${ obj.commands.push }
146
+ """
147
+ }
146
148
}
147
149
}
148
150
}
0 commit comments