diff --git a/interface.json b/interface.json index a9471f4f..3658cc29 100644 --- a/interface.json +++ b/interface.json @@ -27,6 +27,9 @@ "magicRollback": { "type": "boolean" }, + "checks": { + "type": "boolean" + }, "confirmTimeout": { "type": "integer" }, diff --git a/src/bin/deploy.rs b/src/bin/deploy.rs index 7f6fd206..2f8b9ba6 100644 --- a/src/bin/deploy.rs +++ b/src/bin/deploy.rs @@ -50,10 +50,14 @@ struct Opts { #[clap(short, long)] result_path: Option, - /// Skip the automatic pre-build checks + /// Skip the automatic pre-build checks (DEPRECATED) #[clap(short, long)] skip_checks: bool, + /// Run nix flake check before doing anything + #[clap(long)] + check: bool, + /// Override the SSH user with the given value #[clap(long)] ssh_user: Option, @@ -635,6 +639,7 @@ async fn run() -> Result<(), RunError> { temp_path: opts.temp_path, confirm_timeout: opts.confirm_timeout, dry_activate: opts.dry_activate, + check: opts.check, }; let supports_flakes = test_flake_support().await.map_err(RunError::FlakeTest)?; @@ -644,10 +649,17 @@ async fn run() -> Result<(), RunError> { } if !opts.skip_checks { + info!("deploy-rs does not perform checks automatically anymore; use --check to get the old behavior"); + } else { + warn!("--skip-checks is DEPRECATED since now it is the default behavior; use --check to run checks"); + } + + if cmd_overrides.check { for deploy_flake in deploy_flakes.iter() { check_deployment(supports_flakes, deploy_flake.repo, &opts.extra_build_args).await?; } } + let result_path = opts.result_path.as_deref(); let data = get_deployment_data(supports_flakes, &deploy_flakes, &opts.extra_build_args).await?; run_deploy( diff --git a/src/data.rs b/src/data.rs index 6fe7f75f..3b78c3af 100644 --- a/src/data.rs +++ b/src/data.rs @@ -28,6 +28,8 @@ pub struct GenericSettings { pub temp_path: Option, #[serde(rename(deserialize = "magicRollback"))] pub magic_rollback: Option, + #[serde(rename(deserialize = "checks"))] + pub checks: Option, } #[derive(Deserialize, Debug, Clone)] diff --git a/src/lib.rs b/src/lib.rs index 712b8b1f..52470a8b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -161,6 +161,7 @@ pub struct CmdOverrides { pub temp_path: Option, pub confirm_timeout: Option, pub dry_activate: bool, + pub check: bool, } #[derive(PartialEq, Debug)]