mirror of
https://github.com/triqs/dft_tools
synced 2025-01-08 20:33:16 +01:00
[jenkins] move docs to separate gh-pages repo
This commit is contained in:
parent
6d2a788ed3
commit
331bbc8068
30
Jenkinsfile
vendored
30
Jenkinsfile
vendored
@ -30,13 +30,13 @@ for (int i = 0; i < dockerPlatforms.size(); i++) {
|
|||||||
def platform = dockerPlatforms[i]
|
def platform = dockerPlatforms[i]
|
||||||
platforms[platform] = { -> node('docker') {
|
platforms[platform] = { -> node('docker') {
|
||||||
stage(platform) { timeout(time: 1, unit: 'HOURS') {
|
stage(platform) { timeout(time: 1, unit: 'HOURS') {
|
||||||
checkout scm
|
checkout scm
|
||||||
/* construct a Dockerfile for this base */
|
/* construct a Dockerfile for this base */
|
||||||
sh """
|
sh """
|
||||||
( echo "FROM flatironinstitute/triqs:${triqsBranch}-${env.STAGE_NAME}" ; sed '0,/^FROM /d' Dockerfile ) > Dockerfile.jenkins
|
( echo "FROM flatironinstitute/triqs:${triqsBranch}-${env.STAGE_NAME}" ; sed '0,/^FROM /d' Dockerfile ) > Dockerfile.jenkins
|
||||||
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/${projectName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} .")
|
||||||
if (!publish || platform != documentationPlatform) {
|
if (!publish || platform != documentationPlatform) {
|
||||||
/* but we don't need the tag so clean it up (except for documentation) */
|
/* but we don't need the tag so clean it up (except for documentation) */
|
||||||
@ -72,8 +72,8 @@ for (int i = 0; i < osxPlatforms.size(); i++) {
|
|||||||
"LIBRARY_PATH=$triqsDir/lib:${env.BREW}/lib",
|
"LIBRARY_PATH=$triqsDir/lib:${env.BREW}/lib",
|
||||||
"CMAKE_PREFIX_PATH=$triqsDir/share/cmake"]) {
|
"CMAKE_PREFIX_PATH=$triqsDir/share/cmake"]) {
|
||||||
deleteDir()
|
deleteDir()
|
||||||
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 -j3"
|
||||||
try {
|
try {
|
||||||
sh "make test"
|
sh "make test"
|
||||||
} catch (exc) {
|
} catch (exc) {
|
||||||
@ -96,30 +96,30 @@ try {
|
|||||||
def workDir = pwd()
|
def workDir = pwd()
|
||||||
/* Update documention on gh-pages branch */
|
/* Update documention on gh-pages branch */
|
||||||
dir("$workDir/gh-pages") {
|
dir("$workDir/gh-pages") {
|
||||||
def subdir = env.BRANCH_NAME
|
def subdir = "${projectName}/${env.BRANCH_NAME}"
|
||||||
git(url: "ssh://git@github.com/TRIQS/${projectName}.git", branch: "gh-pages", 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/${projectName}:${env.BRANCH_NAME}-${documentationPlatform}").inside() {
|
||||||
sh "cp -rp \$INSTALL/share/doc/${projectName} ${subdir}"
|
sh "cp -rp \$INSTALL/share/doc/${projectName} ${subdir}"
|
||||||
}
|
}
|
||||||
sh "git add -A ${subdir}"
|
sh "git add -A ${subdir}"
|
||||||
sh """
|
sh """
|
||||||
git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' --allow-empty -m 'Generated documentation for ${env.BRANCH_NAME}' -m '${env.BUILD_TAG} ${commit}'
|
git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' --allow-empty -m 'Generated documentation for ${subdir}' -m '${env.BUILD_TAG} ${commit}'
|
||||||
"""
|
"""
|
||||||
// note: credentials used above don't work (need JENKINS-28335)
|
// note: credentials used above don't work (need JENKINS-28335)
|
||||||
sh "git push origin gh-pages"
|
sh "git push origin master"
|
||||||
}
|
}
|
||||||
/* Update docker repo submodule */
|
/* Update docker repo submodule */
|
||||||
dir("$workDir/docker") { try {
|
dir("$workDir/docker") { try {
|
||||||
git(url: "ssh://git@github.com/TRIQS/docker.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false)
|
git(url: "ssh://git@github.com/TRIQS/docker.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false)
|
||||||
sh "echo '160000 commit ${commit}\t${projectName}' | git update-index --index-info"
|
sh "echo '160000 commit ${commit}\t${projectName}' | git update-index --index-info"
|
||||||
sh """
|
sh """
|
||||||
git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}'
|
git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' --allow-empty -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}'
|
||||||
"""
|
"""
|
||||||
// note: credentials used above don't work (need JENKINS-28335)
|
// note: credentials used above don't work (need JENKINS-28335)
|
||||||
sh "git push origin ${env.BRANCH_NAME}"
|
sh "git push origin ${env.BRANCH_NAME}"
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
/* Ignore, non-critical -- might not exist on this branch */
|
/* Ignore, non-critical -- might not exist on this branch */
|
||||||
echo "Failed to update docker repo"
|
echo "Failed to update docker repo"
|
||||||
} }
|
} }
|
||||||
} }
|
} }
|
||||||
|
Loading…
Reference in New Issue
Block a user