3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-29 00:15:00 +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 */
def triqsBranch = env.CHANGE_TARGET ?: env.BRANCH_NAME
def triqsProject = '/TRIQS/triqs/' + triqsBranch.replaceAll('/', '%2F')
/* whether to publish the results (disabled for template project) */
def publish = !env.BRANCH_NAME.startsWith("PR-")
/* whether to keep and publish the results */
def keepInstall = !env.BRANCH_NAME.startsWith("PR-")
properties([
disableConcurrentBuilds(),
@ -38,8 +38,7 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
"""
/* 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} .")
if (!publish || platform != documentationPlatform) {
/* but we don't need the tag so clean it up (except for documentation) */
if (!keepInstall) {
sh "docker rmi --no-prune ${img.imageName()}"
}
} }
@ -59,7 +58,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
def srcDir = pwd()
def tmpDir = pwd(tmp:true)
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}"
dir(installDir) {
deleteDir()
@ -89,7 +88,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
/****************** wrap-up */
try {
parallel platforms
if (publish) { node("docker") {
if (keepInstall) { node("docker") {
/* Publish results */
stage("publish") { timeout(time: 1, unit: 'HOURS') {
def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()