diff options
author | Roman Melnikov | 2023-04-14 13:44:09 +0800 |
---|---|---|
committer | Roman Melnikov | 2023-04-14 13:44:09 +0800 |
commit | 55aac55cfafec93938e19a6b475142d81110b3d4 (patch) | |
tree | 4fe6236b5c2e0c0a46c519243b2693062414e722 /src/push.rs | |
parent | 8c9ea9605eed20528bf60fae35a2b613b901fd77 (diff) |
[#197] Fix hostname overriding for remote builds
Problem: '--hostname' is ignored when used with '--remote-build'.
Solution: Account for 'data.deploy_data.cmd_overrides.hostname' when
building a profile remotely.
Diffstat (limited to '')
-rw-r--r-- | src/push.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/push.rs b/src/push.rs index 6d9f10d..5158dc5 100644 --- a/src/push.rs +++ b/src/push.rs @@ -155,14 +155,12 @@ pub async fn build_profile_remotely(data: &PushProfileData<'_>, derivation_name: data.deploy_data.profile_name, data.deploy_data.node_name ); - let store_address = format!("ssh-ng://{}@{}", - if data.deploy_data.profile.generic_settings.ssh_user.is_some() { - &data.deploy_data.profile.generic_settings.ssh_user.as_ref().unwrap() - } else { - &data.deploy_defs.ssh_user - }, - data.deploy_data.node.node_settings.hostname - ); + // TODO: this should probably be handled more nicely during 'data' construction + let hostname = match data.deploy_data.cmd_overrides.hostname { + Some(ref x) => x, + None => &data.deploy_data.node.node_settings.hostname, + }; + let store_address = format!("ssh-ng://{}@{}", data.deploy_defs.ssh_user, hostname); let ssh_opts_str = data.deploy_data.merged_settings.ssh_opts.join(" "); |