From eab9a23c4f059dfb2723f10d4d1c8ab5dcf4b1bd Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Tue, 28 Jan 2020 11:33:55 -0500 Subject: [PATCH] [jenkins] use lower-case docker name; auto-detect doc dir --- Jenkinsfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ee523db6..442c2641 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,6 @@ def projectName = "app4triqs" /* set to app/repo name */ +def dockerName = projectName.toLowerCase(); /* which platform to build documentation on */ def documentationPlatform = "ubuntu-clang" /* depend on triqs upstream branch/project */ @@ -37,7 +38,7 @@ for (int i = 0; i < dockerPlatforms.size(); i++) { mv -f Dockerfile.jenkins Dockerfile """ /* 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/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .") if (!keepInstall) { sh "docker rmi --no-prune ${img.imageName()}" } @@ -74,7 +75,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) { /* note: this is installing into the parent (triqs) venv (install dir), which is thus shared among apps and so not be completely safe */ sh "pip install -r $srcDir/requirements.txt" sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir" - sh "make -j3" + sh "make -j2" try { sh "make test CTEST_OUTPUT_ON_FAILURE=1" } catch (exc) { @@ -102,8 +103,13 @@ try { def subdir = "${projectName}/${env.BRANCH_NAME}" git(url: "ssh://git@github.com/TRIQS/TRIQS.github.io.git", branch: "master", credentialsId: "ssh", changelog: false) sh "rm -rf ${subdir}" - docker.image("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() { - sh "cp -rp \$INSTALL/share/doc/${projectName} ${subdir}" + docker.image("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() { + sh """#!/bin/bash -ex + base=\$INSTALL/share/doc + dir="${projectName}" + [[ -d \$base/triqs_\$dir ]] && dir=triqs_\$dir || [[ -d \$base/\$dir ]] + cp -rp \$base/\$dir ${subdir}" + """ } sh "git add -A ${subdir}" sh """