Change to build directory inside shell blocks
authorJan Dittberner <jan@dittberner.info>
Sun, 27 Aug 2017 19:46:49 +0000 (21:46 +0200)
committerJan Dittberner <jan@dittberner.info>
Sun, 27 Aug 2017 19:46:49 +0000 (21:46 +0200)
Jenkinsfile

index ba5ea4d..b983486 100644 (file)
@@ -14,9 +14,7 @@ pipeline {
             steps {
                 sh "rm -rf '${GOPATH}/src/git.cacert.org' ; mkdir -p '${GOPATH}/src/git.cacert.org'"
                 sh "ln -s '${pwd()}' '${BUILDDIR}'"
-                dir("${BUILDDIR}") {
-                    sh "pwd ; go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
-                }
+                sh "cd '${BUILDDIR} ; go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
             }
         }
         stage('Build') {
@@ -24,9 +22,7 @@ pipeline {
                 BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
             }
             steps {
-                dir("${BUILDDIR}") {
-                    sh 'make clean && make'
-                }
+                sh "cd '${BUILDDIR}' ; make clean && make"
             }
         }
         stage('Create build output') {