Install the go-bindata binary before build
[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 stage('Fetch go dependencies') {
11 environment {
12 BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
13 }
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 sh "cd '${BUILDDIR}' ; go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
18 sh "go get -u github.com/shuLhan/go-bindata/go-bindata"
19 }
20 }
21 stage('Build') {
22 environment {
23 BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
24 }
25 steps {
26 sh "cd '${BUILDDIR}' ; make clean && make BUILD='${env.BUILD_TAG}'"
27 }
28 }
29 stage('Create build output') {
30 steps {
31 archiveArtifacts artifacts: 'cacert-boardvoting,config.yaml.example'
32 }
33 }
34 }
35 }