#!groovy pipeline { agent any environment { GOPATH = "${pwd(tmp: true)}/gocode" } 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'" 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 { dir("${BUILDDIR}") { sh 'make clean && make' } } } stage('Create build output') { steps { archiveArtifacts artifacts: 'cacert-boardvoting,templates/**,db/**,config.yaml.example,static/**' } } } }