Skip to content

Commit d3fc7f1

Browse files
committed
Reland: trigger-cmk-distro-package: Only archive on success
The package signing will fail if the created package does not adhere to requirements that are currently implemented via tests. The trigger job would still continue to archive results created during it's run - even though these might be unsigned. With this change artifacts are only archived for the trigger job if the signing succeeded. If these artifacts are of relevance (e.g. for debugging) they now have to be retrieved at the triggered jobs. This change avoids situations where build-cmk-deliverables would download unsigned artifacts from trigger-cmk-distro-package. References CMK-31275 Change-Id: I287ec56cf7ad8ff8448f7052db9072c3eb8979a6
1 parent c5b0c79 commit d3fc7f1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

buildscripts/scripts/trigger-cmk-distro-package.groovy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void main() {
4343
}
4444
}
4545
def bazel_log_prefix = "bazel_log_";
46+
def signing_build_instance = null;
4647

4748
print(
4849
"""
@@ -147,7 +148,7 @@ void main() {
147148
condition: currentBuild.result == "SUCCESS",
148149
raiseOnError: true,
149150
) {
150-
smart_build(
151+
signing_build_instance = smart_build(
151152
// see global-defaults.yml, needs to run in minimal container
152153
use_upstream_build: true,
153154
relative_job_name: "${branch_base_folder}/builders/sign-cmk-distro-package",
@@ -171,7 +172,11 @@ void main() {
171172
}
172173
}
173174

174-
stage("Archive stuff") {
175+
smart_stage(
176+
name: "Archive stuff",
177+
condition: signing_build_instance != null && signing_build_instance.result.toString() == "SUCCESS",
178+
raiseOnError: true,
179+
) {
175180
dir("${checkout_dir}") {
176181
show_duration("archiveArtifacts") {
177182
archiveArtifacts(

0 commit comments

Comments
 (0)