Define target build directory environment variable
authorJan Dittberner <jan@dittberner.info>
Sun, 27 Aug 2017 19:42:25 +0000 (21:42 +0200)
committerJan Dittberner <jan@dittberner.info>
Sun, 27 Aug 2017 19:42:25 +0000 (21:42 +0200)
Jenkinsfile

index a99c722..6e97b0e 100644 (file)
@@ -7,18 +7,21 @@ pipeline {
     }
 
     stages {
     }
 
     stages {
+        environment {
+            BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
+        }
         stage('Fetch go dependencies') {
             steps {
                 sh "rm -rf '${GOPATH}/src/git.cacert.org' ; mkdir -p '${GOPATH}/src/git.cacert.org'"
         stage('Fetch go dependencies') {
             steps {
                 sh "rm -rf '${GOPATH}/src/git.cacert.org' ; mkdir -p '${GOPATH}/src/git.cacert.org'"
-                sh "ln -s '${pwd()}' '${GOPATH}/src/git.cacert.org/cacert-boardvoting'"
-                dir("${GOPATH}/src/git.cacert.org/cacert-boardvoting") {
-                    sh "go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
+                sh "ln -s '${pwd()}' '${BUILDDIR}'"
+                dir("${BUILDDIR}") {
+                    sh "pwd ; go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
                 }
             }
         }
         stage('Build') {
             steps {
                 }
             }
         }
         stage('Build') {
             steps {
-                dir("${GOPATH}/src/git.cacert.org/cacert-boardvoting") {
+                dir("${BUILDDIR}") {
                     sh 'make clean && make'
                 }
             }
                     sh 'make clean && make'
                 }
             }