From b0a099cc1514549384aa41b6405ee4e42a8d7920 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Jul 2025 12:17:59 +0200 Subject: [PATCH] RAN-Container-Parent: Auto-generate artifact in failure case RAN-Container-Parent uses Jenkinsfile-GitLab-Container, which only triggers sub pipelines, then collects their results. However, if a sub pipeline did not generate an artifact, the result was skipped. It would also not show it in the automatically generated result page, when it should. Remedy this by automatically generating a file with a link to the pipeline if the artifact could not be retrieved, which 1. Will give a link, which is easier for developers to follow to the pipeline than manually clicking through Jenkins, 2. Makes the failed pipeline appear in the list of failed pipelines. --- ci-scripts/Jenkinsfile-GitLab-Container | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index 62ab0266b1..f2a84fbd91 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -835,11 +835,13 @@ def finalizeSlaveJob(jobName) { selector: lastCompleted()) if (fileExists(fileName)) { sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}" - archiveArtifacts artifacts: fileName - // BUILD_URL is like http://server:port/jenkins/job/foo/15/ - // no need to add a prefixed '/' - artifactUrl += 'artifact/' + fileName + } else { + sh "echo \"could not copy results from ${jobName}, please check pipeline ${BUILD_URL}\" > ${fileName}" } + archiveArtifacts artifacts: fileName + // BUILD_URL is like http://server:port/jenkins/job/foo/15/ + // no need to add a prefixed '/' + artifactUrl += 'artifact/' + fileName } artifactUrl = "\n * [${jobName}](${artifactUrl})" return artifactUrl