From d0c86650424ae60209767a90d5c93012c95b0fec Mon Sep 17 00:00:00 2001 From: Philipp Herzog Date: Wed, 14 Sep 2022 12:38:08 +0200 Subject: Add option to build on the remote host --- src/lib.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 39bc3aa..738fa81 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -163,6 +163,7 @@ pub struct CmdOverrides { pub confirm_timeout: Option, pub sudo: Option, pub dry_activate: bool, + pub remote_build: bool, } #[derive(PartialEq, Debug)] @@ -395,10 +396,10 @@ impl<'a> DeployData<'a> { } fn get_sudo(&'a self) -> String { - return match self.merged_settings.sudo { - Some(ref x) => x.clone(), - None => "sudo -u".to_string() - }; + match self.merged_settings.sudo { + Some(ref x) => x.clone(), + None => "sudo -u".to_string(), + } } } @@ -416,6 +417,10 @@ pub fn make_deploy_data<'a, 's>( merged_settings.merge(node.generic_settings.clone()); merged_settings.merge(top_settings.clone()); + // build all machines remotely when the command line flag is set + if cmd_overrides.remote_build { + merged_settings.remote_build = Some(cmd_overrides.remote_build); + } if cmd_overrides.ssh_user.is_some() { merged_settings.ssh_user = cmd_overrides.ssh_user.clone(); } -- cgit v1.2.3