aboutsummaryrefslogtreecommitdiff
path: root/src/utils/deploy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/deploy.rs')
-rw-r--r--src/utils/deploy.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/utils/deploy.rs b/src/utils/deploy.rs
index 900743c..42bd0b4 100644
--- a/src/utils/deploy.rs
+++ b/src/utils/deploy.rs
@@ -9,6 +9,7 @@ pub async fn deploy_profile(
node_name: &str,
merged_settings: &data::GenericSettings,
deploy_data: &super::DeployData<'_>,
+ auto_rollback: bool,
) -> Result<(), Box<dyn std::error::Error>> {
info!(
"Activating profile `{}` for node `{}`",
@@ -16,8 +17,16 @@ pub async fn deploy_profile(
);
let mut self_activate_command = format!(
- "{} activate '{}' '{}'",
- deploy_data.current_exe.as_path().to_str().unwrap(),
+ "{} '{}' '{}'",
+ deploy_data
+ .current_exe
+ .as_path()
+ .parent()
+ .unwrap()
+ .to_str()
+ .unwrap()
+ .to_owned()
+ + "/activate",
deploy_data.profile_path,
profile.profile_settings.path,
);
@@ -40,6 +49,10 @@ pub async fn deploy_profile(
);
}
+ if auto_rollback {
+ self_activate_command = format!("{} --auto-rollback", self_activate_command);
+ }
+
let mut c = Command::new("ssh");
let mut ssh_command = c.arg(format!(
"ssh://{}@{}",