From a701017a4cef40b00ba1edd09d60602cec253952 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sun, 11 Jul 2021 16:18:10 +0300 Subject: [PATCH 1/2] Skip checks by default --- src/bin/deploy.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bin/deploy.rs b/src/bin/deploy.rs index 7f6fd206..1c064e11 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(short, long)] + check: bool, + /// Override the SSH user with the given value #[clap(long)] ssh_user: Option, @@ -644,10 +648,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 not it is the default behavior; use --check to run checks"); + } + + if opts.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( From 2a96be74aaaeca4bb1ad1d0365c1ee0ceab906c3 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sun, 11 Jul 2021 22:29:35 +0300 Subject: [PATCH 2/2] fixup! Skip checks by default --- interface.json | 3 +++ src/bin/deploy.rs | 7 ++++--- src/data.rs | 2 ++ src/lib.rs | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) 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 1c064e11..2f8b9ba6 100644 --- a/src/bin/deploy.rs +++ b/src/bin/deploy.rs @@ -55,7 +55,7 @@ struct Opts { skip_checks: bool, /// Run nix flake check before doing anything - #[clap(short, long)] + #[clap(long)] check: bool, /// Override the SSH user with the given value @@ -639,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)?; @@ -650,10 +651,10 @@ 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 not it is the default behavior; use --check to run checks"); + warn!("--skip-checks is DEPRECATED since now it is the default behavior; use --check to run checks"); } - if opts.check { + if cmd_overrides.check { for deploy_flake in deploy_flakes.iter() { check_deployment(supports_flakes, deploy_flake.repo, &opts.extra_build_args).await?; } 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)]