@@ -49,15 +49,13 @@ var (
4949 Short : "Deploy ROFL to a specified machine" ,
5050 Args : cobra .NoArgs ,
5151 Run : func (_ * cobra.Command , _ []string ) {
52- cfg := cliConfig .Global ()
53- npa := common .GetNPASelection (cfg )
5452 txCfg := common .GetTransactionConfig ()
5553
5654 if txCfg .Offline {
5755 cobra .CheckErr ("offline mode currently not supported" )
5856 }
5957
60- manifest , deployment := roflCommon .LoadManifestAndSetNPA (cfg , npa , deploymentName , & roflCommon.ManifestOptions {
58+ manifest , deployment , npa := roflCommon .LoadManifestAndSetNPA (& roflCommon.ManifestOptions {
6159 NeedAppID : true ,
6260 NeedAdmin : true ,
6361 })
@@ -105,15 +103,15 @@ var (
105103 if roflServices , ok := provider .DefaultRoflServices [npa .ParaTime .ID ]; ok {
106104 deployProvider = roflServices .Provider
107105 } else {
108- cobra .CheckErr (fmt .Sprintf ("Provider not configured for deployment '%s' machine '%s'. Please specify --provider." , deploymentName , deployMachine ))
106+ cobra .CheckErr (fmt .Sprintf ("Provider not configured for deployment '%s' machine '%s'. Please specify --provider." , roflCommon . DeploymentName , deployMachine ))
109107 }
110108 }
111109
112110 machine .Provider = deployProvider
113111 default :
114112 // Already set, require the provider to be omitted or equal.
115113 if deployProvider != "" && deployProvider != machine .Provider {
116- cobra .CheckErr (fmt .Sprintf ("Provider '%s' conflicts with existing provider '%s' for deployment '%s' machine '%s'. Omit --provider." , deployProvider , machine .Provider , deploymentName , deployMachine ))
114+ cobra .CheckErr (fmt .Sprintf ("Provider '%s' conflicts with existing provider '%s' for deployment '%s' machine '%s'. Omit --provider." , deployProvider , machine .Provider , roflCommon . DeploymentName , deployMachine ))
117115 }
118116 }
119117
@@ -132,7 +130,7 @@ var (
132130 }
133131
134132 ociRepository := ociRepository (deployment )
135- orcFilename := roflCommon .GetOrcFilename (manifest , deploymentName )
133+ orcFilename := roflCommon .GetOrcFilename (manifest , roflCommon . DeploymentName )
136134 fmt .Printf ("Pushing ROFL app to OCI repository '%s'...\n " , ociRepository )
137135 ociDigest , manifestHash := pushBundleToOciRepository (orcFilename , ociRepository )
138136 // Save the OCI repository field to the configuration file so we avoid multiple uploads.
@@ -200,7 +198,7 @@ var (
200198 TermCount : deployTermCount ,
201199 })
202200
203- acc := common .LoadAccount (cfg , npa .AccountName )
201+ acc := common .LoadAccount (cliConfig . Global () , npa .AccountName )
204202 var sigTx , meta any
205203 sigTx , meta , err = common .SignParaTimeTransaction (ctx , npa , acc , conn , tx , nil )
206204 cobra .CheckErr (err )
@@ -260,12 +258,12 @@ var (
260258 Method : scheduler .MethodDeploy ,
261259 Args : cbor .Marshal (scheduler.DeployRequest {
262260 Deployment : machineDeployment ,
263- WipeStorage : false ,
261+ WipeStorage : roflCommon . WipeStorage ,
264262 }),
265263 })},
266264 })
267265
268- acc := common .LoadAccount (cfg , npa .AccountName )
266+ acc := common .LoadAccount (cliConfig . Global () , npa .AccountName )
269267 var sigTx , meta any
270268 sigTx , meta , err = common .SignParaTimeTransaction (ctx , npa , acc , conn , tx , nil )
271269 cobra .CheckErr (err )
@@ -455,8 +453,8 @@ func init() {
455453 providerFlags .BoolVar (& deployShowOffers , "show-offers" , false , "show all provider offers and quit" )
456454 providerFlags .BoolVar (& deployReplaceMachine , "replace-machine" , false , "rent a new machine if the provided one expired" )
457455
458- deployCmd .Flags ().AddFlagSet (common .SelectorFlags )
459456 deployCmd .Flags ().AddFlagSet (common .RuntimeTxFlags )
460- deployCmd .Flags ().AddFlagSet (deploymentFlags )
461457 deployCmd .Flags ().AddFlagSet (providerFlags )
458+ deployCmd .Flags ().AddFlagSet (roflCommon .DeploymentFlags )
459+ deployCmd .Flags ().AddFlagSet (roflCommon .WipeFlags )
462460}
0 commit comments