2021-07-15 02:44:07 +00:00
|
|
|
package cli
|
|
|
|
|
|
|
|
import "github.com/urfave/cli/v2"
|
|
|
|
|
|
|
|
var appNewCommand = &cli.Command{
|
|
|
|
Name: "new",
|
2021-07-15 05:17:47 +00:00
|
|
|
Flags: []cli.Flag{
|
|
|
|
ServerFlag,
|
|
|
|
DomainFlag,
|
|
|
|
AppNameFlag,
|
|
|
|
PassFlag,
|
|
|
|
SecretsFlag,
|
|
|
|
},
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
var appDeployCommand = &cli.Command{
|
|
|
|
Name: "deploy",
|
2021-07-15 05:17:47 +00:00
|
|
|
Flags: []cli.Flag{
|
|
|
|
UpdateFlag,
|
|
|
|
ForceFlag,
|
|
|
|
SkipVersionCheckFlag,
|
|
|
|
NoDomainPollFlag,
|
|
|
|
},
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
var appUndeployCommand = &cli.Command{
|
|
|
|
Name: "undeploy",
|
|
|
|
}
|
|
|
|
var appBackupCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "backup",
|
|
|
|
Flags: []cli.Flag{AllFlag},
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
var appRestoreCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "restore",
|
|
|
|
Flags: []cli.Flag{AllFlag},
|
|
|
|
ArgsUsage: "<service> [<backup file>]",
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
var appListCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "list",
|
|
|
|
Aliases: []string{"ls"},
|
|
|
|
Flags: []cli.Flag{StatusFlag, ServerFlag, TypeFlag},
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
var appCheckCommand = &cli.Command{
|
|
|
|
Name: "check",
|
|
|
|
}
|
|
|
|
var appCpCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "cp",
|
|
|
|
ArgsUsage: "<src> <dst>",
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
var appConfigCommand = &cli.Command{
|
|
|
|
Name: "config",
|
|
|
|
}
|
|
|
|
var appLogsCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "logs",
|
|
|
|
ArgsUsage: "[<service>]",
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var appPsCommand = &cli.Command{
|
|
|
|
Name: "ps",
|
|
|
|
}
|
|
|
|
var appRemoveCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "remove",
|
|
|
|
Flags: []cli.Flag{VolumesFlag, SecretsFlag},
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
var appRunCommand = &cli.Command{
|
|
|
|
Name: "run",
|
2021-07-15 05:17:47 +00:00
|
|
|
Flags: []cli.Flag{
|
|
|
|
NoTTYFlag,
|
|
|
|
UserFlag,
|
|
|
|
},
|
|
|
|
ArgsUsage: "<service> <args>...",
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var appRollbackCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "rollback",
|
|
|
|
ArgsUsage: "[<version>]",
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
|
2021-07-15 05:17:47 +00:00
|
|
|
// TODO: Replicating what the bash abra does might be hard
|
|
|
|
// with the mix of subcommands and flags
|
2021-07-15 02:44:07 +00:00
|
|
|
var appSecretCommand = &cli.Command{
|
2021-07-15 05:17:47 +00:00
|
|
|
Name: "secret",
|
|
|
|
Flags: []cli.Flag{AllFlag, PassFlag},
|
2021-07-15 02:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var AppCommand = &cli.Command{
|
|
|
|
Name: "app",
|
|
|
|
HideHelp: true,
|
|
|
|
Subcommands: []*cli.Command{
|
|
|
|
appNewCommand,
|
|
|
|
appConfigCommand,
|
|
|
|
appDeployCommand,
|
|
|
|
appUndeployCommand,
|
|
|
|
appBackupCommand,
|
|
|
|
appRestoreCommand,
|
|
|
|
appRemoveCommand,
|
|
|
|
appCheckCommand,
|
|
|
|
appListCommand,
|
|
|
|
appPsCommand,
|
|
|
|
appLogsCommand,
|
|
|
|
appCpCommand,
|
|
|
|
appRunCommand,
|
|
|
|
appRollbackCommand,
|
|
|
|
appSecretCommand,
|
|
|
|
},
|
|
|
|
}
|