mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 20:34:38 +01:00
[jenkins] use lower-case docker name; auto-detect doc dir
This commit is contained in:
parent
3111d800b5
commit
eab9a23c4f
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@ -1,5 +1,6 @@
|
|||||||
def projectName = "app4triqs" /* set to app/repo name */
|
def projectName = "app4triqs" /* set to app/repo name */
|
||||||
|
|
||||||
|
def dockerName = projectName.toLowerCase();
|
||||||
/* which platform to build documentation on */
|
/* which platform to build documentation on */
|
||||||
def documentationPlatform = "ubuntu-clang"
|
def documentationPlatform = "ubuntu-clang"
|
||||||
/* depend on triqs upstream branch/project */
|
/* depend on triqs upstream branch/project */
|
||||||
@ -37,7 +38,7 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
|
|||||||
mv -f Dockerfile.jenkins Dockerfile
|
mv -f Dockerfile.jenkins Dockerfile
|
||||||
"""
|
"""
|
||||||
/* 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/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .")
|
||||||
if (!keepInstall) {
|
if (!keepInstall) {
|
||||||
sh "docker rmi --no-prune ${img.imageName()}"
|
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 */
|
/* 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 "pip install -r $srcDir/requirements.txt"
|
||||||
sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir"
|
sh "cmake $srcDir -DCMAKE_INSTALL_PREFIX=$installDir -DTRIQS_ROOT=$triqsDir"
|
||||||
sh "make -j3"
|
sh "make -j2"
|
||||||
try {
|
try {
|
||||||
sh "make test CTEST_OUTPUT_ON_FAILURE=1"
|
sh "make test CTEST_OUTPUT_ON_FAILURE=1"
|
||||||
} catch (exc) {
|
} catch (exc) {
|
||||||
@ -102,8 +103,13 @@ try {
|
|||||||
def subdir = "${projectName}/${env.BRANCH_NAME}"
|
def subdir = "${projectName}/${env.BRANCH_NAME}"
|
||||||
git(url: "ssh://git@github.com/TRIQS/TRIQS.github.io.git", branch: "master", credentialsId: "ssh", changelog: false)
|
git(url: "ssh://git@github.com/TRIQS/TRIQS.github.io.git", branch: "master", credentialsId: "ssh", changelog: false)
|
||||||
sh "rm -rf ${subdir}"
|
sh "rm -rf ${subdir}"
|
||||||
docker.image("flatironinstitute/${projectName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() {
|
docker.image("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() {
|
||||||
sh "cp -rp \$INSTALL/share/doc/${projectName} ${subdir}"
|
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 add -A ${subdir}"
|
||||||
sh """
|
sh """
|
||||||
|
Loading…
Reference in New Issue
Block a user