Registry / Framework

framework · v0.1.2
Artifact Promote
Promote exactly the artifact digest token that passed staging and block substituted build IDs.
Use Artifact Promote
use vendor::artifact_promote::artifact_promote;
Run the example
nest demo artifact_promote@0.1.2
blyxc native-run artifact_promote-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::artifact_promote::artifact_promote;
fn main() {
let arguments = cli_args();
if args_len(arguments) > 0 {
if args_len(arguments) % 2 != 0 {
stderr_line("Expected event and value pairs");
process_exit(2);
}
let mut live = artifact_promote_start();
let mut i = 0;
while i < args_len(arguments) {
let input = args_at(arguments, i + 1);
if !text_is_number(input) {
stderr_line("Expected a whole numeric event value");
process_exit(2);
}
live = artifact_promote_step(live, args_at(arguments, i), text_number(input));
let command = artifact_promote_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = artifact_promote_start();
state = artifact_promote_step(state, "build", 17.0);
println!(artifact_promote_command(state));
state = artifact_promote_step(state, "passed", 17.0);
println!(artifact_promote_command(state));
state = artifact_promote_step(state, "approve", 17.0);
println!(artifact_promote_command(state));
state = artifact_promote_step(state, "promote", 18.0);
println!(artifact_promote_command(state));
state = artifact_promote_step(state, "promote", 17.0);
println!(artifact_promote_command(state));
}
Expected output
deploy_staging
request_signoff
permit_promotion
reject
deploy_production
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | ae53b937c7 | 0fd495eff0e501bf14b436d67eb6d2877ff0e8dd153ae383bdf9e794befd48b5 |
| 0.1.1 | Download ZIP · Browse files | fdc3593f1a | afc9eda47ffc78dd4768f7a3b260caec88613ea5b6ceb5e91eaefc4001120571 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | 5e63fadc36c9f421a36879fe020645e9dbac5988203858106a8a243a83224ed7 |