11use super :: { SecretDeliverArgs , UiEnvironmentName } ;
22use anyhow:: { anyhow, Context , Result } ;
33use skillet_cli_common:: hosts:: ApplyPhase ;
4- use skillet_vm:: {
5- credential:: ActivationPolicy ,
6- transport:: { GuestCommand , GuestTransport , SshTransport } ,
7- } ;
4+ use skillet_vm:: { credential:: ActivationPolicy , transport:: SshTransport } ;
85use skillet_workstation:: { host_apply, vault:: Vault } ;
96use std:: path:: PathBuf ;
107
@@ -22,6 +19,9 @@ pub(super) struct Args {
2219 /// Provision all declared services over verified SSH to USER@HOST
2320 #[ arg( long, requires = "host" ) ]
2421 target : Option < String > ,
22+ /// Reuse installed guest binaries instead of deploying current source
23+ #[ arg( long, requires = "target" ) ]
24+ no_deploy : bool ,
2525 #[ arg( long, default_value_t = 22 ) ]
2626 port : u16 ,
2727 /// SSH private key; omitted uses OpenSSH configuration, defaults and agent
@@ -88,17 +88,17 @@ fn remote(args: &Args) -> Result<()> {
8888 args. identity . as_deref ( ) ,
8989 args. known_hosts . as_deref ( ) ,
9090 ) ?;
91- let identity = transport. execute (
92- & GuestCommand {
93- program : "cat" ,
94- arguments : & [ "/etc/skillet/host" ] ,
95- } ,
96- None ,
97- ) ?;
98- if !identity . status . success ( ) || std :: str :: from_utf8 ( & identity . stdout ) ? . trim ( ) != host {
99- return Err ( anyhow ! (
100- "SSH host identity differs from selected host; no credentials delivered"
101- ) ) ;
91+ skillet_workstation :: deployment :: verify_host ( host , & transport) ? ;
92+ if args . no_deploy {
93+ println ! (
94+ "Workstation Skillet {}; deployment skipped (--no-deploy)" ,
95+ skillet_cli_common :: version :: version ( )
96+ ) ;
97+ let installed = skillet_workstation :: deployment :: installed_versions ( host , & transport ) ?;
98+ println ! ( "Installed: {}" , installed . generic_version ) ;
99+ println ! ( "Installed: {}" , installed . host_version ) ;
100+ } else {
101+ super :: deploy :: deploy ( host , & transport ) ? ;
102102 }
103103 let path = args. database . clone ( ) . map_or_else ( Vault :: default_path, Ok ) ?;
104104 let mut vault = Vault :: open ( & path, args. key_file . as_deref ( ) ) ?;
0 commit comments