difftreelog
feat(build-systems) builders/jobs/fail_fast args
in: trunk
1 file changed
src/cmds/build_systems.rsdiffbeforeafterboth17 /// Host, which should be threaten as localhost17 /// Host, which should be threaten as localhost18 #[clap(long, env = "FLEET_LOCALHOST")]18 #[clap(long, env = "FLEET_LOCALHOST")]19 localhost: Option<String>,19 localhost: Option<String>,20 /// --builders arg for nix21 #[clap(long)]22 builders: Option<String>,23 /// Jobs to run locally24 #[clap(long)]25 jobs: Option<usize>,26 /// Do not continue on error27 #[clap(long)]28 fail_fast: bool,20 #[clap(subcommand)]29 #[clap(subcommand)]21 subcommand: Option<Subcommand>,30 subcommand: Option<Subcommand>,22}31}61 dir.path().to_owned()70 dir.path().to_owned()62 };71 };637264 Command::new("nix")73 let mut nix_build = Command::new("nix");74 nix_build65 .args(&["build", "--impure", "--no-link", "--out-link"])75 .args(&["build", "--impure", "--no-link", "--out-link"])66 .arg(&built)76 .arg(&built)67 .arg(format!(77 .arg(format!(68 "{}.{}.config.system.build.toplevel",78 "{}.{}.config.system.build.toplevel",69 SYSTEMS_ATTRIBUTE, host,79 SYSTEMS_ATTRIBUTE, host,70 ))80 ))71 .env("SECRET_DATA", data.clone())81 .env("SECRET_DATA", data.clone());8283 if let Some(builders) = &self.builders {84 println!("Using builders: {}", builders);85 nix_build.arg("--builders").arg(builders);86 }87 if let Some(jobs) = &self.jobs {88 nix_build.arg("--jobs");89 nix_build.arg(format!("{}", jobs));90 }91 if !self.fail_fast {92 nix_build.arg("--keep-going");93 }9472 .inherit_stdio()95 nix_build.inherit_stdio().run()?;73 .run()?;74 let built = std::fs::canonicalize(built)?;96 let built = std::fs::canonicalize(built)?;75 info!("Built closure: {:?}", built);97 info!("Built closure: {:?}", built);86 if subcommand.should_switch_profile() {108 if subcommand.should_switch_profile() {87 info!("Switching generation");109 info!("Switching generation");88 if !is_local {110 if !is_local {89 Command::ssh_on(host, "nix-env")111 Command::ssh_on(host, "sudo")90 } else {112 } else {91 Command::new("nix-env")113 Command::new("sudo")92 }114 }93 .args(&["-p", "/nix/var/nix/profiles/system", "--set"])115 .args(&["nix-env", "-p", "/nix/var/nix/profiles/system", "--set"])94 .arg(&built)116 .arg(&built)95 .inherit_stdio()117 .inherit_stdio()96 .run()?;118 .run()?;