Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip checks by default #102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions interface.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"magicRollback": {
"type": "boolean"
},
"checks": {
"type": "boolean"
},
"confirmTimeout": {
"type": "integer"
},
Expand Down
14 changes: 13 additions & 1 deletion src/bin/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ struct Opts {
#[clap(short, long)]
result_path: Option<String>,

/// 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<String>,
Expand Down Expand Up @@ -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)?;
Expand All @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pub struct GenericSettings {
pub temp_path: Option<String>,
#[serde(rename(deserialize = "magicRollback"))]
pub magic_rollback: Option<bool>,
#[serde(rename(deserialize = "checks"))]
pub checks: Option<bool>,
}

#[derive(Deserialize, Debug, Clone)]
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ pub struct CmdOverrides {
pub temp_path: Option<String>,
pub confirm_timeout: Option<u16>,
pub dry_activate: bool,
pub check: bool,
}

#[derive(PartialEq, Debug)]
Expand Down