fistful-server/Jenkinsfile

80 lines
1.4 KiB
Plaintext
Raw Normal View History

2018-06-13 13:43:48 +00:00
#!groovy
// -*- mode: groovy -*-
def finalHook = {
runStage('store CT logs') {
archive '_build/test/logs/'
}
}
build('fistful-server', 'docker-host', finalHook) {
checkoutRepo()
loadBuildUtils()
def pipeDefault
def withWsCache
runStage('load pipeline') {
env.JENKINS_LIB = "build-utils/jenkins_lib"
pipeDefault = load("${env.JENKINS_LIB}/pipeDefault.groovy")
withWsCache = load("${env.JENKINS_LIB}/withWsCache.groovy")
}
def masterlike() {
return (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic'))
}
pipeDefault() {
if (!masterlike()) {
runStage('compile') {
withGithubPrivkey {
sh 'make wc_compile'
}
}
runStage('lint') {
sh 'make wc_lint'
}
runStage('xref') {
sh 'make wc_xref'
}
runStage('dialyze') {
withWsCache("_build/default/rebar3_19.3_plt") {
sh 'make wc_dialyze'
}
}
runStage('test') {
sh "make wdeps_test"
}
}
runStage('make release') {
withGithubPrivkey {
sh "make wc_release"
}
}
runStage('build image') {
sh "make build_image"
}
try {
if (masterlike()) {
runStage('push image') {
sh "make push_image"
}
}
} finally {
runStage('rm local image') {
sh 'make rm_local_image'
}
}
}
}