Skip to content

Commit

Permalink
[jenkins] Change Jenkinsfile to automatically update TRIQS/packaging …
Browse files Browse the repository at this point in the history
…repository
  • Loading branch information
Wentzell committed Mar 22, 2024
1 parent c9259f7 commit 027bda3
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand All @@ -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://[email protected]/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 <[email protected]>' --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://[email protected]/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 <[email protected]>' -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}'
git push origin ${env.BRANCH_NAME}
Expand Down

0 comments on commit 027bda3

Please sign in to comment.