diff options
author | Alexander Bantyev | 2022-12-29 18:25:47 +0400 |
---|---|---|
committer | GitHub | 2022-12-29 18:25:47 +0400 |
commit | 3878dd40f622d327ee912e9b4077909834261772 (patch) | |
tree | f03a91ee3d24ebfb149baa9c7eb052a97f01b99f /src/cli.rs | |
parent | 2a3c5f70eee04a465aa534d8bd4fcc9bb3c4a8ce (diff) | |
parent | 068372aad18f04122bbdb836e36c655c157ebe71 (diff) |
Merge pull request #176 from Ma27/activate-boot
Add new activation strategy `boot` as equivalent to `nixos-rebuild boot`
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -90,6 +90,9 @@ pub struct Opts { /// Show what will be activated on the machines #[clap(long)] dry_activate: bool, + /// Don't activate, but update the boot loader to boot into the new profile + #[clap(long)] + boot: bool, /// Revoke all previously succeeded deploys when deploying multiple profiles #[clap(long)] rollback_succeeded: Option<bool>, @@ -411,6 +414,7 @@ async fn run_deploy( extra_build_args: &[String], debug_logs: bool, dry_activate: bool, + boot: bool, log_dir: &Option<String>, rollback_succeeded: bool, ) -> Result<(), RunDeployError> { @@ -562,7 +566,7 @@ async fn run_deploy( // Rollbacks adhere to the global seeting to auto_rollback and secondary // the profile's configuration for (_, deploy_data, deploy_defs) in &parts { - if let Err(e) = deploy::deploy::deploy_profile(deploy_data, deploy_defs, dry_activate).await + if let Err(e) = deploy::deploy::deploy_profile(deploy_data, deploy_defs, dry_activate, boot).await { error!("{}", e); if dry_activate { @@ -619,6 +623,10 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> { &deploy::LoggerType::Deploy, )?; + if opts.dry_activate && opts.boot { + error!("Cannot use both --dry-activate & --boot!"); + } + let deploys = opts .clone() .targets @@ -669,6 +677,7 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> { &opts.extra_build_args, opts.debug_logs, opts.dry_activate, + opts.boot, &opts.log_dir, opts.rollback_succeeded.unwrap_or(true), ) |