feat(app): Adds abra app move command
This commit is contained in:
@ -142,6 +142,59 @@ func getDeployType(currentVersion, newVersion string) string {
|
||||
return i18n.G("DOWNGRADE")
|
||||
}
|
||||
|
||||
// MoveOverview shows a overview before moving an app to a different server
|
||||
func MoveOverview(
|
||||
app appPkg.App,
|
||||
newServer string,
|
||||
secrets []string,
|
||||
volumes []string,
|
||||
) {
|
||||
server := app.Server
|
||||
if app.Server == "default" {
|
||||
server = "local"
|
||||
}
|
||||
|
||||
domain := app.Domain
|
||||
if domain == "" {
|
||||
domain = config.NO_DOMAIN_DEFAULT
|
||||
}
|
||||
|
||||
rows := [][]string{
|
||||
{"DOMAIN", domain},
|
||||
{"RECIPE", app.Recipe.Name},
|
||||
{"OLD SERVER", server},
|
||||
{"New SERVER", newServer},
|
||||
{"SECRETS", strings.Join(secrets, "\n")},
|
||||
{"VOLUMES", strings.Join(volumes, "\n")},
|
||||
}
|
||||
|
||||
overview := formatter.CreateOverview("MOVE OVERVIEW", rows)
|
||||
|
||||
fmt.Println(overview)
|
||||
}
|
||||
|
||||
func PromptProcced() error {
|
||||
if NoInput {
|
||||
return nil
|
||||
}
|
||||
|
||||
if Dry {
|
||||
return fmt.Errorf("dry run")
|
||||
}
|
||||
|
||||
response := false
|
||||
prompt := &survey.Confirm{Message: "proceed?"}
|
||||
if err := survey.AskOne(prompt, &response); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !response {
|
||||
return errors.New("cancelled")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// PostCmds parses a string of commands and executes them inside of the respective services
|
||||
// the commands string must have the following format:
|
||||
// "<service> <command> <arguments>|<service> <command> <arguments>|... "
|
||||
|
Reference in New Issue
Block a user