2016-12-22 15:09:40 +00:00
|
|
|
#!groovy
|
|
|
|
|
|
|
|
build('koffing', 'docker-host') {
|
|
|
|
checkoutRepo()
|
|
|
|
loadBuildUtils()
|
|
|
|
|
|
|
|
def pipeDefault
|
2017-02-09 18:58:51 +00:00
|
|
|
def withWsCache
|
2016-12-22 15:09:40 +00:00
|
|
|
runStage('load pipeline') {
|
|
|
|
env.JENKINS_LIB = "build_utils/jenkins_lib"
|
|
|
|
pipeDefault = load("${env.JENKINS_LIB}/pipeDefault.groovy")
|
2017-02-09 18:58:51 +00:00
|
|
|
withWsCache = load("${env.JENKINS_LIB}/withWsCache.groovy")
|
2016-12-22 15:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pipeDefault() {
|
|
|
|
runStage('init') {
|
|
|
|
withGithubSshCredentials {
|
2017-02-09 18:58:51 +00:00
|
|
|
withWsCache("node_modules") {
|
|
|
|
sh 'make wc_init'
|
|
|
|
}
|
2016-12-22 15:09:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
runStage('build') {
|
|
|
|
sh 'make wc_build'
|
|
|
|
}
|
|
|
|
runStage('build image') {
|
|
|
|
sh 'make build_image'
|
|
|
|
}
|
|
|
|
|
2017-11-03 12:52:42 +00:00
|
|
|
runStage('test image') {
|
|
|
|
sh 'make test'
|
|
|
|
}
|
|
|
|
|
2016-12-22 15:09:40 +00:00
|
|
|
try {
|
|
|
|
if (env.BRANCH_NAME == 'master') {
|
|
|
|
runStage('push image') {
|
|
|
|
sh 'make push_image'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} finally {
|
|
|
|
runStage('rm local image') {
|
|
|
|
sh 'make rm_local_image'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|