Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## To Be Released

* feat(cmd): add `valkey-console`

## 1.48.0

* feat(pitr): add command to fetch recovery window of a database
Expand Down
2 changes: 1 addition & 1 deletion cmd/addon_providers_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var (
AddonProvidersListCommand = cli.Command{
addonProvidersListCommand = cli.Command{
Name: "addons-list",
Category: "Addons - Global",
Description: "List all addons you can add to your app",
Expand Down
2 changes: 1 addition & 1 deletion cmd/addons_providers_plans_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var (
AddonProvidersPlansCommand = cli.Command{
addonProvidersPlansCommand = cli.Command{
Name: "addons-plans",
Category: "Addons - Global",
ArgsUsage: "addon-id",
Expand Down
52 changes: 33 additions & 19 deletions cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,25 @@ func NewAppCommands() *AppCommands {
return &cmds
}

const (
categoryDatabases = "Databases"

flagSizeName = "size"
flagSizeUsage = "Size of the container"
flagEnvName = "env"
flagEnvUsage = "Environment variable name to use for the connection to the database"

mySQLConsole = "mysql-console"
mongoConsole = "mongo-console"
pgSQLConsole = "pgsql-console"
)

var (
regionalCommands = []*cli.Command{
// Apps
&appsCommand,
&CreateCommand,
&DestroyCommand,
&createCommand,
&destroyCommand,
&renameCommand,
&appsInfoCommand,
&openCommand,
Expand All @@ -174,7 +187,7 @@ var (
// Apps Process Actions
&psCommand,
&scaleCommand,
&RestartCommand,
&restartCommand,
&sendSignalCommand,

// Routing Settings
Expand All @@ -185,7 +198,7 @@ var (
&unsetCanonicalDomainCommand,

// Events
&UserTimelineCommand,
&userTimelineCommand,
&timelineCommand,

// Environment
Expand All @@ -195,10 +208,10 @@ var (
&envUnsetCommand,

// Domains
&DomainsListCommand,
&DomainsAddCommand,
&DomainsRemoveCommand,
&DomainsSSLCommand,
&domainsListCommand,
&domainsAddCommand,
&domainsRemoveCommand,
&domainsSSLCommand,

// Deployments
&deploymentsListCommand,
Expand All @@ -218,8 +231,8 @@ var (
&stacksSetCommand,

// Addons
&AddonProvidersListCommand,
&AddonProvidersPlansCommand,
&addonProvidersListCommand,
&addonProvidersPlansCommand,
&addonsListCommand,
&addonsAddCommand,
&addonsRemoveCommand,
Expand All @@ -239,18 +252,19 @@ var (
&reviewAppsShowCommand,

// Notifiers
&NotifiersListCommand,
&NotifiersDetailsCommand,
&NotifiersAddCommand,
&NotifiersUpdateCommand,
&NotifiersRemoveCommand,
&notifiersListCommand,
&notifiersDetailsCommand,
&notifiersAddCommand,
&notifiersUpdateCommand,
&notifiersRemoveCommand,

// Notification platforms
&NotificationPlatformListCommand,
&notificationPlatformListCommand,

// DB Access
&DbTunnelCommand,
&RedisConsoleCommand,
&dbTunnelCommand,
&redisConsoleCommand,
&valkeyConsoleCommand,
&MongoConsoleCommand,
&MySQLConsoleCommand,
&PgSQLConsoleCommand,
Expand Down Expand Up @@ -288,7 +302,7 @@ var (
&alertsRemoveCommand,

// Stats
&StatsCommand,
&statsCommand,

// Autoscalers
&autoscalersListCommand,
Expand Down
2 changes: 1 addition & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

var (
CreateCommand = cli.Command{
createCommand = cli.Command{
Name: "create",
Aliases: []string{"c"},
Category: "Global",
Expand Down
2 changes: 1 addition & 1 deletion cmd/db_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

var (
DbTunnelCommand = cli.Command{
dbTunnelCommand = cli.Command{
Name: "db-tunnel",
Category: "App Management",
Usage: "Create an encrypted connection to access your database",
Expand Down
2 changes: 1 addition & 1 deletion cmd/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The version reference is optional (generated from timestamp if none).
It is a reference to the code you are deploying, version, commit SHA, etc.`,
Examples: []string{
"scalingo --app my-app deploy archive.tar.gz v1.0.0",
"scalingo --app my-app deploy http://example.com/archive.tar.gz v1.0.0",
"scalingo --app my-app deploy https://example.com/archive.tar.gz v1.0.0",
"scalingo --app my-app deploy --no-follow archive.tar.gz v1.0.0",
"scalingo --app my-app deployment-follow",
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

var (
DestroyCommand = cli.Command{
destroyCommand = cli.Command{
Name: "destroy",
Category: "App Management",
Flags: []cli.Flag{&appFlag,
Expand Down
8 changes: 4 additions & 4 deletions cmd/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

var (
DomainsListCommand = cli.Command{
domainsListCommand = cli.Command{
Name: "domains",
Category: "Custom Domains",
Flags: []cli.Flag{&appFlag},
Expand Down Expand Up @@ -47,7 +47,7 @@ var (
},
}

DomainsAddCommand = cli.Command{
domainsAddCommand = cli.Command{
Name: "domains-add",
Category: "Custom Domains",
Usage: "Add a custom domain to an application",
Expand Down Expand Up @@ -106,7 +106,7 @@ var (
},
}

DomainsRemoveCommand = cli.Command{
domainsRemoveCommand = cli.Command{
Name: "domains-remove",
Category: "Custom Domains",
Flags: []cli.Flag{&appFlag},
Expand Down Expand Up @@ -140,7 +140,7 @@ var (
}

// TODO: Split the two operations (enable/disable) into two subcommands
DomainsSSLCommand = cli.Command{
domainsSSLCommand = cli.Command{
Name: "domains-ssl",
Category: "Custom Domains",
Usage: "Enable or disable SSL for your custom domains",
Expand Down
16 changes: 8 additions & 8 deletions cmd/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

var (
envCommand = cli.Command{
Name: "env",
Name: flagEnvName,
Category: "Environment",
Flags: []cli.Flag{&appFlag, databaseFlag()},
Usage: "Display the environment variables of your apps",
Expand All @@ -28,7 +28,7 @@ var (
currentApp := detect.GetCurrentResource(ctx, c)
var err error
if c.Args().Len() != 0 {
_ = cli.ShowCommandHelp(ctx, c, "env")
_ = cli.ShowCommandHelp(ctx, c, flagEnvName)
return nil
}

Expand All @@ -42,7 +42,7 @@ var (
return nil
},
ShellComplete: func(_ context.Context, c *cli.Command) {
_ = autocomplete.CmdFlagsAutoComplete(c, "env")
_ = autocomplete.CmdFlagsAutoComplete(c, flagEnvName)
},
}

Expand All @@ -55,12 +55,12 @@ var (
Description: CommandDescription{
Description: "Get the value of a specific environment variable",
Examples: []string{"scalingo --app my-app env-get VAR1"},
SeeAlso: []string{"env", "env-set", "env-unset"},
SeeAlso: []string{flagEnvName, "env-set", "env-unset"},
}.Render(),

Action: func(ctx context.Context, c *cli.Command) error {
if c.Args().Len() != 1 {
_ = cli.ShowCommandHelp(ctx, c, "env")
_ = cli.ShowCommandHelp(ctx, c, flagEnvName)
return nil
}

Expand All @@ -76,7 +76,7 @@ var (
return nil
},
ShellComplete: func(_ context.Context, c *cli.Command) {
_ = autocomplete.CmdFlagsAutoComplete(c, "env")
_ = autocomplete.CmdFlagsAutoComplete(c, flagEnvName)
},
}

Expand All @@ -96,7 +96,7 @@ var (
"scalingo --app my-app env-set --file - < .env",
"scalingo --app my-app env-set --file .env VAR2=VAL2",
},
SeeAlso: []string{"env", "env-get", "env-unset"},
SeeAlso: []string{flagEnvName, "env-get", "env-unset"},
}.Render(),
Action: func(ctx context.Context, c *cli.Command) error {
if c.Args().Len() == 0 && c.String("f") == "" {
Expand Down Expand Up @@ -125,7 +125,7 @@ var (
Description: CommandDescription{
Description: "Unset variables",
Examples: []string{"scalingo --app my-app env-unset VAR1 VAR2"},
SeeAlso: []string{"env", "env-get", "env-set"},
SeeAlso: []string{flagEnvName, "env-get", "env-set"},
}.Render(),

Action: func(ctx context.Context, c *cli.Command) error {
Expand Down
10 changes: 5 additions & 5 deletions cmd/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ var (
InfluxDBConsoleCommand = cli.Command{
Name: "influxdb-console",
Aliases: []string{"influx-console"},
Category: "Databases",
Category: categoryDatabases,
Usage: "Run an interactive console with your InfluxDB addon",
Flags: []cli.Flag{&appFlag,
&cli.StringFlag{Name: "size", Aliases: []string{"s"}, Value: "", Usage: "Size of the container"},
&cli.StringFlag{Name: "env", Aliases: []string{"e"}, Value: "", Usage: "Environment variable name to use for the connection to the database"},
&cli.StringFlag{Name: flagSizeName, Aliases: []string{"s"}, Value: "", Usage: flagSizeUsage},
&cli.StringFlag{Name: flagEnvName, Aliases: []string{"e"}, Value: "", Usage: flagEnvUsage},
},
Description: CommandDescription{
Description: `Run an interactive console with your InfluxDB addon

The --size flag makes it easy to specify the size of the container executing
the InfluxDB console. Each container size has different price and performance.
You can read more about container sizes here:
http://doc.scalingo.com/internals/container-sizes.html`,
https://doc.scalingo.com/platform/internals/container-sizes`,
Examples: []string{
"scalingo --app my-app influxdb-console",
"scalingo --app my-app influxdb-console --size L",
"scalingo --app my-app influxdb-console --env MY_INFLUXDB_URL",
},
SeeAlso: []string{"mongo-console", "mysql-console"},
SeeAlso: []string{mongoConsole, mySQLConsole},
}.Render(),
Action: func(ctx context.Context, c *cli.Command) error {
if c.Args().Len() != 0 {
Expand Down
16 changes: 8 additions & 8 deletions cmd/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@ import (

var (
MongoConsoleCommand = cli.Command{
Name: "mongo-console",
Name: mongoConsole,
Aliases: []string{"mongodb-console"},
Category: "Databases",
Category: categoryDatabases,
Usage: "Run an interactive console with your MongoDB addon",
Flags: []cli.Flag{&appFlag,
&cli.StringFlag{Name: "size", Aliases: []string{"s"}, Value: "", Usage: "Size of the container"},
&cli.StringFlag{Name: "env", Aliases: []string{"e"}, Value: "", Usage: "Environment variable name to use for the connection to the database"},
&cli.StringFlag{Name: flagSizeName, Aliases: []string{"s"}, Value: "", Usage: flagSizeUsage},
&cli.StringFlag{Name: flagEnvName, Aliases: []string{"e"}, Value: "", Usage: flagEnvUsage},
},
Description: CommandDescription{
Description: `Run an interactive console with your MongoDB addon
The --size flag makes it easy to specify the size of the container executing
the MongoDB console. Each container size has different price and performance.
You can read more about container sizes here:
http://doc.scalingo.com/internals/container-sizes.html`,
https://doc.scalingo.com/platform/internals/container-sizes`,
Examples: []string{
"scalingo --app my-app mongo-console",
"scalingo --app my-app mongo-console --size L",
"scalingo --app my-app mongo-console --env MY_MONGO_URL",
},
SeeAlso: []string{"redis-console", "mysql-console"},
SeeAlso: []string{"redis-console", mySQLConsole},
}.Render(),
Action: func(ctx context.Context, c *cli.Command) error {
if c.Args().Len() != 0 {
_ = cli.ShowCommandHelp(ctx, c, "mongo-console")
_ = cli.ShowCommandHelp(ctx, c, mongoConsole)
return nil
}

Expand All @@ -54,7 +54,7 @@ http://doc.scalingo.com/internals/container-sizes.html`,
return nil
},
ShellComplete: func(_ context.Context, c *cli.Command) {
_ = autocomplete.CmdFlagsAutoComplete(c, "mongo-console")
_ = autocomplete.CmdFlagsAutoComplete(c, mongoConsole)
},
}
)
Loading