Skip to content

Commit 5b926fe

Browse files
authored
ci: use withMageEnv after the dir (#538)
1 parent 88e7e14 commit 5b926fe

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

.ci/Jenkinsfile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ pipeline {
5151
stage('Check') {
5252
steps {
5353
cleanup()
54-
withMageEnv(){
55-
dir("${BASE_DIR}"){
54+
dir("${BASE_DIR}"){
55+
withMageEnv(){
5656
sh(label: 'Check',script: 'make check-static')
5757
}
5858
}
@@ -64,8 +64,8 @@ pipeline {
6464
stage('Unit tests') {
6565
steps {
6666
cleanup()
67-
withMageEnv(){
68-
dir("${BASE_DIR}"){
67+
dir("${BASE_DIR}"){
68+
withMageEnv(){
6969
sh(label: 'Check',script: 'make test-go-ci')
7070
}
7171
}
@@ -105,9 +105,9 @@ pipeline {
105105
tag pattern: '(v)?\\d+\\.\\d+\\.\\d+', comparator: 'REGEXP'
106106
}
107107
steps {
108-
withMageEnv(){
109-
withCredentials([string(credentialsId: "${GITHUB_TOKEN_CREDENTIALS}", variable: 'GITHUB_TOKEN')]) {
110-
dir("${BASE_DIR}") {
108+
dir("${BASE_DIR}"){
109+
withMageEnv(){
110+
withCredentials([string(credentialsId: "${GITHUB_TOKEN_CREDENTIALS}", variable: 'GITHUB_TOKEN')]) {
111111
sh 'curl -sL https://git.io/goreleaser | bash'
112112
}
113113
}
@@ -144,10 +144,10 @@ def generateTestCommandStage(Map args = [:]){
144144
withNode(labels: "ubuntu-18 && immutable", sleepMax: 20, forceWorkspace: true) {
145145
cleanup()
146146
try {
147-
withMageEnv(){
148-
withKubernetes() {
149-
withCloudTestEnv() {
150-
dir("${BASE_DIR}"){
147+
dir("${BASE_DIR}"){
148+
withMageEnv(){
149+
withKubernetes() {
150+
withCloudTestEnv() {
151151
sh(label: 'Check',script: "make build ${command} check-git-clean")
152152
}
153153
}
@@ -215,7 +215,9 @@ def withKubernetes(Closure body) {
215215
chmod +x ${HOME}/bin/kubectl
216216
kubectl version --client
217217
''') }
218-
body()
218+
withEnv(["PATH+TOOLS=${HOME}/bin"]) {
219+
body()
220+
}
219221
}
220222

221223
def withCloudTestEnv(Closure body) {

0 commit comments

Comments
 (0)