Skip to content

Commit

Permalink
Add parallel signing of images to main pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Rautiola <[email protected]>
  • Loading branch information
joinemm committed Nov 4, 2024
1 parent 1089b97 commit f939740
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions ghaf-main-pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,32 @@ def flakeAttr = ".#hydraJobs"
// Target names must be direct children of the above
def targets = [
[ target: "docs.aarch64-linux",
hwtest_device: null ],
archive: false, hwtest_device: null
],
[ target: "docs.x86_64-linux",
hwtest_device: null ],
archive: false, hwtest_device: null
],
[ target: "generic-x86_64-debug.x86_64-linux",
hwtest_device: "nuc" ],
archive: true, hwtest_device: "nuc"
],
[ target: "lenovo-x1-carbon-gen11-debug.x86_64-linux",
hwtest_device: "lenovo-x1" ],
archive: true, hwtest_device: "lenovo-x1"
],
[ target: "microchip-icicle-kit-debug-from-x86_64.x86_64-linux",
hwtest_device: "riscv" ],
archive: true, hwtest_device: "riscv"
],
[ target: "nvidia-jetson-orin-agx-debug.aarch64-linux",
hwtest_device: "orin-agx" ],
archive: true, hwtest_device: "orin-agx"
],
[ target: "nvidia-jetson-orin-agx-debug-from-x86_64.x86_64-linux",
hwtest_device: "orin-agx" ],
archive: true, hwtest_device: "orin-agx"
],
[ target: "nvidia-jetson-orin-nx-debug.aarch64-linux",
hwtest_device: "orin-nx" ],
archive: true, hwtest_device: "orin-nx"
],
[ target: "nvidia-jetson-orin-nx-debug-from-x86_64.x86_64-linux",
hwtest_device: "orin-nx" ],
archive: true, hwtest_device: "orin-nx"
],
]

target_jobs = [:]
Expand Down Expand Up @@ -89,14 +98,20 @@ pipeline {
target_jobs[target] = {
stage("Build ${target}") {
def opts = ""
if (it['hwtest_device'] != null) {
if (it['archive']) {
opts = "--out-link archive/${target}"
} else {
opts = "--no-link"
}
try {
if (drvPath) {
sh "nix build -L ${drvPath}\\^* ${opts}"

// only attempt signing if there is something to sign
if (it['archive']) {
def img_relpath = utils.find_img_relpath(target, "archive")
utils.sign_file("archive/${img_relpath}", "sig/${img_relpath}.sig")
}
} else {
error("Target \"${target}\" was not found in ${flakeAttr}")
}
Expand All @@ -109,13 +124,16 @@ pipeline {
}
}

if (it['hwtest_device'] != null) {
if (it['archive']) {
stage("Archive ${target}") {
script {
utils.archive_artifacts("archive", target)
utils.archive_artifacts("sig", target)
}
}
}

if (it['hwtest_device'] != null) {
stage("Test ${target}") {
utils.ghaf_parallel_hw_test(target, it['hwtest_device'], '_boot_bat_')
}
Expand Down

0 comments on commit f939740

Please sign in to comment.