From 027bda3265e7d0c19ecce849fac356e2f1b1b4ff Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 22 Mar 2024 16:00:06 -0400 Subject: [PATCH] [jenkins] Change Jenkinsfile to automatically update TRIQS/packaging repository --- Jenkinsfile | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 059714ca..0a764fb7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,10 +43,10 @@ for (int i = 0; i < dockerPlatforms.size(); i++) { if (platform == documentationPlatform) args = '-DBuild_Documentation=0' else if (platform == "sanitize") - args = '-DASAN=ON -DUBSAN=ON' + args = '-DASAN=ON -DUBSAN=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo' def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_ID=${env.BUILD_TAG} --build-arg CMAKE_ARGS='${args}' .") catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { - img.inside() { + img.inside("--shm-size=4gb") { sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1" } } @@ -62,40 +62,20 @@ for (int i = 0; i < dockerPlatforms.size(); i++) { def error = null try { parallel platforms - if (false/*keepInstall*/) { node('linux && docker && triqs') { + if (keepInstall) { node('linux && docker && triqs') { /* Publish results */ stage("publish") { timeout(time: 5, unit: 'MINUTES') { def commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim() def release = env.BRANCH_NAME == "master" || env.BRANCH_NAME == "unstable" || sh(returnStdout: true, script: "git describe --exact-match HEAD || true").trim() def workDir = pwd(tmp:true) lock('triqs_publish') { - /* Update documention on gh-pages branch */ - dir("$workDir/gh-pages") { - 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/${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 """ - git commit --author='Flatiron Jenkins ' --allow-empty -m 'Generated documentation for ${subdir}' -m '${env.BUILD_TAG} ${commit}' - """ - // note: credentials used above don't work (need JENKINS-28335) - sh "git push origin master" - } /* Update packaging repo submodule */ if (release) { dir("$workDir/packaging") { try { git(url: "ssh://git@github.com/TRIQS/packaging.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false) // note: credentials used above don't work (need JENKINS-28335) sh """#!/bin/bash -ex dir="${projectName}" - [[ -d triqs_\$dir ]] && dir=triqs_\$dir || [[ -d \$dir ]] + [[ -d \$dir ]] && dir=\$dir || [[ -d \$dir ]] echo "160000 commit ${commit}\t\$dir" | git update-index --index-info git commit --author='Flatiron Jenkins ' -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}' git push origin ${env.BRANCH_NAME}