1
0
mirror of https://github.com/rancher/os.git synced 2025-07-05 11:06:13 +00:00
os/vendor/github.com/docker/libcompose/Jenkinsfile
2016-05-23 17:22:40 -07:00

34 lines
881 B
Groovy

wrappedNode(label: 'linux && x86_64') {
deleteDir()
checkout scm
def image
try {
stage "build image"
image = docker.build("dockerbuildbot/libcompose:${gitCommit()}")
stage "validate"
makeTask(image, "validate")
stage "test"
makeTask(image, "test", ["TESTVERBOSE=1", "DAEMON_VERSION=all"])
stage "build"
makeTask(image, "cross-binary")
} finally {
try { archive "bundles" } catch (Exception exc) {}
if (image) { sh "docker rmi ${image.id} ||:" }
}
}
def makeTask(image, task, envVars=null) {
// could send in the full list of envVars for each call or provide default env vars like this:
withEnv((envVars ?: []) + ["LIBCOMPOSE_IMAGE=${image.id}"]) { // would need `def image` at top level of file instead of in the nested block
withChownWorkspace {
timeout(60) {
sh "make -e ${task}"
}
}
}
}