aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cli.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cli.rs b/src/cli.rs
index eb9094d..ab9499a 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -56,6 +56,10 @@ pub struct Opts {
#[clap(short, long)]
skip_checks: bool,
+ /// Build on remote host
+ #[clap(long)]
+ remote_build: bool,
+
/// Override the SSH user with the given value
#[clap(long)]
ssh_user: Option<String>,
@@ -141,9 +145,7 @@ async fn check_deployment(
.arg(format!("let r = import {}/.; x = (if builtins.isFunction r then (r {{}}) else r); in if x ? checks then x.checks.${{builtins.currentSystem}} else {{}}", repo));
}
- for extra_arg in extra_build_args {
- check_command.arg(extra_arg);
- }
+ check_command.args(extra_build_args);
let check_status = check_command.status().await?;
@@ -242,9 +244,7 @@ async fn get_deployment_data(
.arg(format!("let r = import {}/.; in if builtins.isFunction r then (r {{}}).deploy else r.deploy", flake.repo))
};
- for extra_arg in extra_build_args {
- c.arg(extra_arg);
- }
+ c.args(extra_build_args);
let build_child = c
.stdout(Stdio::piped())
@@ -391,6 +391,8 @@ pub enum RunDeployError {
PromptDeployment(#[from] PromptDeploymentError),
#[error("Failed to revoke profile: {0}")]
RevokeProfile(#[from] deploy::deploy::RevokeProfileError),
+ #[error("Deployment failed, rolled back to previous generation")]
+ Rollback
}
type ToDeploy<'a> = Vec<(
@@ -581,7 +583,7 @@ async fn run_deploy(
}
}
}
- break;
+ return Err(RunDeployError::Rollback);
}
succeeded.push((deploy_data, deploy_defs))
}
@@ -646,6 +648,7 @@ pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
temp_path: opts.temp_path,
confirm_timeout: opts.confirm_timeout,
dry_activate: opts.dry_activate,
+ remote_build: opts.remote_build,
sudo: opts.sudo,
};