3
0
mirror of https://github.com/triqs/dft_tools synced 2024-07-17 00:20:39 +02:00

[jenkins] Preserve all installs by default

as triqs does already
This commit is contained in:
Dylan Simon 2019-07-26 14:01:22 -04:00
parent 8d906ed6cc
commit 7aaffab7e6

11
Jenkinsfile vendored
View File

@ -5,8 +5,8 @@ def documentationPlatform = "ubuntu-clang"
/* depend on triqs upstream branch/project */ /* depend on triqs upstream branch/project */
def triqsBranch = env.CHANGE_TARGET ?: env.BRANCH_NAME def triqsBranch = env.CHANGE_TARGET ?: env.BRANCH_NAME
def triqsProject = '/TRIQS/triqs/' + triqsBranch.replaceAll('/', '%2F') def triqsProject = '/TRIQS/triqs/' + triqsBranch.replaceAll('/', '%2F')
/* whether to publish the results (disabled for template project) */ /* whether to keep and publish the results */
def publish = !env.BRANCH_NAME.startsWith("PR-") def keepInstall = !env.BRANCH_NAME.startsWith("PR-")
properties([ properties([
disableConcurrentBuilds(), disableConcurrentBuilds(),
@ -38,8 +38,7 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
""" """
/* build and tag */ /* build and tag */
def img = docker.build("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .") def img = docker.build("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .")
if (!publish || platform != documentationPlatform) { if (!keepInstall) {
/* but we don't need the tag so clean it up (except for documentation) */
sh "docker rmi --no-prune ${img.imageName()}" sh "docker rmi --no-prune ${img.imageName()}"
} }
} } } }
@ -59,7 +58,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
def srcDir = pwd() def srcDir = pwd()
def tmpDir = pwd(tmp:true) def tmpDir = pwd(tmp:true)
def buildDir = "$tmpDir/build" def buildDir = "$tmpDir/build"
def installDir = "$tmpDir/install" def installDir = keepInstall ? "${env.HOME}/install/${projectName}/${env.BRANCH_NAME}/${platform}" : "$tmpDir/install"
def triqsDir = "${env.HOME}/install/triqs/${triqsBranch}/${platform}" def triqsDir = "${env.HOME}/install/triqs/${triqsBranch}/${platform}"
dir(installDir) { dir(installDir) {
deleteDir() deleteDir()
@ -89,7 +88,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
/****************** wrap-up */ /****************** wrap-up */
try { try {
parallel platforms parallel platforms
if (publish) { node("docker") { if (keepInstall) { node("docker") {
/* Publish results */ /* Publish results */
stage("publish") { timeout(time: 1, unit: 'HOURS') { stage("publish") { timeout(time: 1, unit: 'HOURS') {
def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim() def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()