16 lines
489 B
Plaintext
16 lines
489 B
Plaintext
|
|
#!/usr/bin/env nu
|
||
|
|
# build-rollback.nu — compensation for build-crate.
|
||
|
|
# Removes build artifacts for the failed pipeline run.
|
||
|
|
|
||
|
|
def main []: nothing -> nothing {
|
||
|
|
let run_id = ($env | get --ignore-errors PIPELINE_RUN_ID | default "unknown")
|
||
|
|
print $"Compensating build for pipeline run [$run_id]"
|
||
|
|
|
||
|
|
let clean = (do { ^cargo clean } | complete)
|
||
|
|
if ($clean.exit_code != 0) {
|
||
|
|
print $"WARNING: cargo clean failed: ($clean.stderr)"
|
||
|
|
} else {
|
||
|
|
print "Build artifacts cleaned"
|
||
|
|
}
|
||
|
|
}
|