Define target build directory environment variable
[cacert-boardvoting.git] / Jenkinsfile
1 #!groovy
2 pipeline {
3 agent any
4
5 environment {
6 GOPATH = "${pwd(tmp: true)}/gocode"
7 }
8
9 stages {
10 environment {
11 BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
12 }
13 stage('Fetch go dependencies') {
14 steps {
15 sh "rm -rf '${GOPATH}/src/git.cacert.org' ; mkdir -p '${GOPATH}/src/git.cacert.org'"
16 sh "ln -s '${pwd()}' '${BUILDDIR}'"
17 dir("${BUILDDIR}") {
18 sh "pwd ; go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
19 }
20 }
21 }
22 stage('Build') {
23 steps {
24 dir("${BUILDDIR}") {
25 sh 'make clean && make'
26 }
27 }
28 }
29 stage('Create build output') {
30 steps {
31 archiveArtifacts artifacts: 'cacert-boardvoting,templates/**,db/**,config.yaml.example,static/**'
32 }
33 }
34 }
35 }