34 lines
1 KiB
Groovy
34 lines
1 KiB
Groovy
#!groovy
|
|
pipeline {
|
|
agent any
|
|
|
|
environment {
|
|
GOPATH = "${pwd(tmp: true)}/gocode"
|
|
}
|
|
|
|
stages {
|
|
stage('Fetch go dependencies') {
|
|
environment {
|
|
BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
|
|
}
|
|
steps {
|
|
sh "rm -rf '${GOPATH}/src/git.cacert.org' ; mkdir -p '${GOPATH}/src/git.cacert.org'"
|
|
sh "ln -s '${pwd()}' '${BUILDDIR}'"
|
|
sh "cd '${BUILDDIR}' ; go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
|
|
}
|
|
}
|
|
stage('Build') {
|
|
environment {
|
|
BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
|
|
}
|
|
steps {
|
|
sh "cd '${BUILDDIR}' ; make clean && make BUILD='${env.BUILD_TAG}'"
|
|
}
|
|
}
|
|
stage('Create build output') {
|
|
steps {
|
|
archiveArtifacts artifacts: 'cacert-boardvoting,templates/**,db/**,config.yaml.example,static/**'
|
|
}
|
|
}
|
|
}
|
|
}
|