Skip to content
Snippets Groups Projects
Commit 4554627d authored by Jakob Kaiser's avatar Jakob Kaiser
Browse files

feat: always archive artifacts

Change-Id: I29998b8b9027480d807a5aee740f13fc03d3e00b
parent c8f5a8e4
No related branches found
No related tags found
No related merge requests found
...@@ -116,37 +116,30 @@ pipeline { ...@@ -116,37 +116,30 @@ pipeline {
stage('Build container image') { stage('Build container image') {
steps { steps {
script { script {
try { // extract options from gerrit comment
// extract options from gerrit comment boolean with_debug = false
boolean with_debug = false boolean with_spack_verbose = false
boolean with_spack_verbose = false String build_cache_name = "${params.BUILD_CACHE_NAME}"
String build_cache_name = "${params.BUILD_CACHE_NAME}" if (isTriggeredByGerrit()) {
if (isTriggeredByGerrit()) { gerrit_comment = jesh(script: "echo '${GERRIT_EVENT_COMMENT_TEXT}' | base64 -d", returnStdout: true)
gerrit_comment = jesh(script: "echo '${GERRIT_EVENT_COMMENT_TEXT}' | base64 -d", returnStdout: true) with_debug = gerrit_comment.contains("WITH_DEBUG")
with_debug = gerrit_comment.contains("WITH_DEBUG") with_spack_verbose = gerrit_comment.contains("WITH_SPACK_VERBOSE")
with_spack_verbose = gerrit_comment.contains("WITH_SPACK_VERBOSE") build_cache_name = jesh(script: "bash bin/yashchiki_get_build_cache_name.sh", returnStdout: true).trim()
build_cache_name = jesh(script: "bash bin/yashchiki_get_build_cache_name.sh", returnStdout: true).trim()
}
sh "python3 bin/yashchiki ${CONTAINER_STYLE} ${WORKSPACE}/spack ${YASHCHIKI_IMAGE_NAME} " +
"--log-dir=log " +
"--tmp-subdir=${env.NODE_NAME} " +
"--meta-dir=${YASHCHIKI_META_DIR} " +
"--caches-dir=${YASHCHIKI_CACHES_ROOT} " +
"--sandboxes-dir=${YASHCHIKI_SANDBOXES} " +
"--build-cache-name=${build_cache_name} " +
("${CONTAINER_BUILD_TYPE}" == "stable" ? "--update-build-cache " : "") +
"--recipe-filename=${WORKSPACE}/visionary_recipe.def " +
"--build-cache-on-failure-name=${YASHCHIKI_BUILD_CACHE_ON_FAILURE_NAME} " +
(with_debug ? "--debug " : "") +
(with_spack_verbose ? "--spack-verbose " : "") +
"--jobs=" + jesh(script: "nproc", returnStdout: true).trim() + " "
} catch (Throwable t) {
archiveArtifacts "errors_concretization.log"
throw t
} }
archiveArtifacts(artifacts: "sandboxes/*/opt/spack_specs/*.yaml", allowEmptyArchive: true)
archiveArtifacts(artifacts: "log/*.log", allowEmptyArchive: true) sh "python3 bin/yashchiki ${CONTAINER_STYLE} ${WORKSPACE}/spack ${YASHCHIKI_IMAGE_NAME} " +
"--log-dir=log " +
"--tmp-subdir=${env.NODE_NAME} " +
"--meta-dir=${YASHCHIKI_META_DIR} " +
"--caches-dir=${YASHCHIKI_CACHES_ROOT} " +
"--sandboxes-dir=${YASHCHIKI_SANDBOXES} " +
"--build-cache-name=${build_cache_name} " +
("${CONTAINER_BUILD_TYPE}" == "stable" ? "--update-build-cache " : "") +
"--recipe-filename=${WORKSPACE}/visionary_recipe.def " +
"--build-cache-on-failure-name=${YASHCHIKI_BUILD_CACHE_ON_FAILURE_NAME} " +
(with_debug ? "--debug " : "") +
(with_spack_verbose ? "--spack-verbose " : "") +
"--jobs=" + jesh(script: "nproc", returnStdout: true).trim() + " "
} }
} }
} }
...@@ -173,6 +166,9 @@ pipeline { ...@@ -173,6 +166,9 @@ pipeline {
} }
cleanup { cleanup {
archiveArtifacts "out_singularity_build_recipe.txt" archiveArtifacts "out_singularity_build_recipe.txt"
archiveArtifacts(artifacts: "errors_concretization.log", allowEmptyArchive: true)
archiveArtifacts(artifacts: "sandboxes/*/opt/spack_specs/*.yaml", allowEmptyArchive: true)
archiveArtifacts(artifacts: "log/*.log", allowEmptyArchive: true)
} }
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment