Use static assets for HTML templates
[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 }
19 }
20 stage('Build') {
21 environment {
22 BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
23 }
24 steps {
25 sh "cd '${BUILDDIR}' ; make clean && make BUILD='${env.BUILD_TAG}'"
26 }
27 }
28 stage('Create build output') {
29 steps {
30 archiveArtifacts artifacts: 'cacert-boardvoting,templates/**,db/**,config.yaml.example,static/**'
31 }
32 }
33 }
34 }