refactor!: maintain "domain"
All checks were successful
continuous-integration/drone/push Build is passing

See toolshed/organising#636
This commit is contained in:
decentral1se 2025-01-03 08:24:03 +01:00
parent 2dc8034c16
commit 1194f3b228
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
23 changed files with 36 additions and 36 deletions

View File

@ -11,7 +11,7 @@ import (
) )
var AppBackupListCommand = &cobra.Command{ var AppBackupListCommand = &cobra.Command{
Use: "list <app> [flags]", Use: "list <domain> [flags]",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Short: "List the contents of a snapshot", Short: "List the contents of a snapshot",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
@ -61,7 +61,7 @@ var AppBackupListCommand = &cobra.Command{
} }
var AppBackupDownloadCommand = &cobra.Command{ var AppBackupDownloadCommand = &cobra.Command{
Use: "download <app> [flags]", Use: "download <domain> [flags]",
Aliases: []string{"d"}, Aliases: []string{"d"},
Short: "Download a snapshot", Short: "Download a snapshot",
Long: `Downloads a backup.tar.gz to the current working directory. Long: `Downloads a backup.tar.gz to the current working directory.
@ -130,7 +130,7 @@ var AppBackupDownloadCommand = &cobra.Command{
} }
var AppBackupCreateCommand = &cobra.Command{ var AppBackupCreateCommand = &cobra.Command{
Use: "create <app> [flags]", Use: "create <domain> [flags]",
Aliases: []string{"c"}, Aliases: []string{"c"},
Short: "Create a new snapshot", Short: "Create a new snapshot",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
@ -174,7 +174,7 @@ var AppBackupCreateCommand = &cobra.Command{
} }
var AppBackupSnapshotsCommand = &cobra.Command{ var AppBackupSnapshotsCommand = &cobra.Command{
Use: "snapshots <app> [flags]", Use: "snapshots <domain> [flags]",
Aliases: []string{"s"}, Aliases: []string{"s"},
Short: "List all snapshots", Short: "List all snapshots",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),

View File

@ -13,7 +13,7 @@ import (
) )
var AppCheckCommand = &cobra.Command{ var AppCheckCommand = &cobra.Command{
Use: "check <app> [flags]", Use: "check <domain> [flags]",
Aliases: []string{"chk"}, Aliases: []string{"chk"},
Short: "Ensure an app is well configured", Short: "Ensure an app is well configured",
Long: `Compare env vars in both the app ".env" and recipe ".env.sample" file. Long: `Compare env vars in both the app ".env" and recipe ".env.sample" file.

View File

@ -18,7 +18,7 @@ import (
) )
var AppCmdCommand = &cobra.Command{ var AppCmdCommand = &cobra.Command{
Use: "command <app> [service | --local] <cmd> [[args] [flags] | [flags] -- [args]]", Use: "command <domain> [service | --local] <cmd> [[args] [flags] | [flags] -- [args]]",
Aliases: []string{"cmd"}, Aliases: []string{"cmd"},
Short: "Run app commands", Short: "Run app commands",
Long: `Run an app specific command. Long: `Run an app specific command.
@ -192,7 +192,7 @@ does not).`,
} }
var AppCmdListCommand = &cobra.Command{ var AppCmdListCommand = &cobra.Command{
Use: "list <app> [flags]", Use: "list <domain> [flags]",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Short: "List all available commands", Short: "List all available commands",
Args: cobra.MinimumNArgs(1), Args: cobra.MinimumNArgs(1),

View File

@ -12,7 +12,7 @@ import (
) )
var AppConfigCommand = &cobra.Command{ var AppConfigCommand = &cobra.Command{
Use: "config <app> [flags]", Use: "config <domain> [flags]",
Aliases: []string{"cfg"}, Aliases: []string{"cfg"},
Short: "Edit app config", Short: "Edit app config",
Example: " abra config 1312.net", Example: " abra config 1312.net",

View File

@ -26,7 +26,7 @@ import (
) )
var AppCpCommand = &cobra.Command{ var AppCpCommand = &cobra.Command{
Use: "cp <app> <src> <dst> [flags]", Use: "cp <domain> <src> <dst> [flags]",
Aliases: []string{"c"}, Aliases: []string{"c"},
Short: "Copy files to/from a deployed app service", Short: "Copy files to/from a deployed app service",
Example: ` # copy myfile.txt to the root of the app service Example: ` # copy myfile.txt to the root of the app service

View File

@ -23,7 +23,7 @@ import (
) )
var AppDeployCommand = &cobra.Command{ var AppDeployCommand = &cobra.Command{
Use: "deploy <app> [version] [flags]", Use: "deploy <domain> [version] [flags]",
Aliases: []string{"d"}, Aliases: []string{"d"},
Short: "Deploy an app", Short: "Deploy an app",
Long: `Deploy an app. Long: `Deploy an app.

View File

@ -11,7 +11,7 @@ import (
) )
var AppEnvCommand = &cobra.Command{ var AppEnvCommand = &cobra.Command{
Use: "env <app> [flags]", Use: "env <domain> [flags]",
Aliases: []string{"e"}, Aliases: []string{"e"},
Short: "Show app .env values", Short: "Show app .env values",
Example: " abra app env 1312.net", Example: " abra app env 1312.net",

View File

@ -19,7 +19,7 @@ import (
) )
var AppLabelsCommand = &cobra.Command{ var AppLabelsCommand = &cobra.Command{
Use: "labels <app> [flags]", Use: "labels <domain> [flags]",
Aliases: []string{"lb"}, Aliases: []string{"lb"},
Short: "Show deployment labels", Short: "Show deployment labels",
Long: "Both local recipe and live deployment labels are shown.", Long: "Both local recipe and live deployment labels are shown.",

View File

@ -24,7 +24,7 @@ import (
) )
var AppLogsCommand = &cobra.Command{ var AppLogsCommand = &cobra.Command{
Use: "logs <app> [service] [flags]", Use: "logs <domain> [service] [flags]",
Aliases: []string{"l"}, Aliases: []string{"l"},
Short: "Tail app logs", Short: "Tail app logs",
Args: cobra.RangeArgs(1, 2), Args: cobra.RangeArgs(1, 2),

View File

@ -25,7 +25,7 @@ This new app configuration is stored in your $ABRA_DIR directory under the
appropriate server. appropriate server.
This command does not deploy your app for you. You will need to run "abra app This command does not deploy your app for you. You will need to run "abra app
deploy <app>" to do so. deploy <domain>" to do so.
You can see what recipes are available (i.e. values for the [recipe] argument) You can see what recipes are available (i.e. values for the [recipe] argument)
by running "abra recipe ls". by running "abra recipe ls".

View File

@ -23,7 +23,7 @@ import (
) )
var AppPsCommand = &cobra.Command{ var AppPsCommand = &cobra.Command{
Use: "ps <app> [flags]", Use: "ps <domain> [flags]",
Aliases: []string{"p"}, Aliases: []string{"p"},
Short: "Check app deployment status", Short: "Check app deployment status",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),

View File

@ -16,7 +16,7 @@ import (
) )
var AppRemoveCommand = &cobra.Command{ var AppRemoveCommand = &cobra.Command{
Use: "remove <app> [flags]", Use: "remove <domain> [flags]",
Aliases: []string{"rm"}, Aliases: []string{"rm"},
Short: "Remove all app data, locally and remotely", Short: "Remove all app data, locally and remotely",
Long: `Remove everything related to an app which is already undeployed. Long: `Remove everything related to an app which is already undeployed.

View File

@ -15,12 +15,12 @@ import (
) )
var AppRestartCommand = &cobra.Command{ var AppRestartCommand = &cobra.Command{
Use: "restart <app> [[service] | --all-services] [flags]", Use: "restart <domain> [[service] | --all-services] [flags]",
Aliases: []string{"re"}, Aliases: []string{"re"},
Short: "Restart an app", Short: "Restart an app",
Long: `This command restarts services within a deployed app. Long: `This command restarts services within a deployed app.
Run "abra app ps <app>" to see a list of service names. Run "abra app ps <domain>" to see a list of service names.
Pass "--all-services/-a" to restart all services.`, Pass "--all-services/-a" to restart all services.`,
Example: ` # restart a single app service Example: ` # restart a single app service

View File

@ -12,7 +12,7 @@ import (
) )
var AppRestoreCommand = &cobra.Command{ var AppRestoreCommand = &cobra.Command{
Use: "restore <app> [flags]", Use: "restore <domain> [flags]",
Aliases: []string{"rs"}, Aliases: []string{"rs"},
Short: "Restore a snapshot", Short: "Restore a snapshot",
Long: `Snapshots are restored while apps are deployed. Long: `Snapshots are restored while apps are deployed.

View File

@ -21,7 +21,7 @@ import (
) )
var AppRollbackCommand = &cobra.Command{ var AppRollbackCommand = &cobra.Command{
Use: "rollback <app> [version] [flags]", Use: "rollback <domain> [version] [flags]",
Aliases: []string{"rl"}, Aliases: []string{"rl"},
Short: "Roll an app back to a previous version", Short: "Roll an app back to a previous version",
Long: `This command rolls an app back to a previous version. Long: `This command rolls an app back to a previous version.

View File

@ -17,7 +17,7 @@ import (
) )
var AppRunCommand = &cobra.Command{ var AppRunCommand = &cobra.Command{
Use: "run <app> <service> <cmd> [[args] [flags] | [flags] -- [args]]", Use: "run <domain> <service> <cmd> [[args] [flags] | [flags] -- [args]]",
Aliases: []string{"r"}, Aliases: []string{"r"},
Short: "Run a command inside a service container", Short: "Run a command inside a service container",
Example: ` # run <cmd> with args/flags Example: ` # run <cmd> with args/flags

View File

@ -20,7 +20,7 @@ import (
) )
var AppSecretGenerateCommand = &cobra.Command{ var AppSecretGenerateCommand = &cobra.Command{
Use: "generate <app> [[secret] [version] | --all] [flags]", Use: "generate <domain> [[secret] [version] | --all] [flags]",
Aliases: []string{"g"}, Aliases: []string{"g"},
Short: "Generate secrets", Short: "Generate secrets",
Args: cobra.RangeArgs(1, 3), Args: cobra.RangeArgs(1, 3),
@ -140,7 +140,7 @@ var AppSecretGenerateCommand = &cobra.Command{
} }
var AppSecretInsertCommand = &cobra.Command{ var AppSecretInsertCommand = &cobra.Command{
Use: "insert <app> <secret> <version> <data> [flags]", Use: "insert <domain> <secret> <version> <data> [flags]",
Aliases: []string{"i"}, Aliases: []string{"i"},
Short: "Insert secret", Short: "Insert secret",
Long: `This command inserts a secret into an app environment. Long: `This command inserts a secret into an app environment.
@ -230,7 +230,7 @@ func secretRm(cl *dockerClient.Client, app appPkg.App, secretName, parsed string
} }
var AppSecretRmCommand = &cobra.Command{ var AppSecretRmCommand = &cobra.Command{
Use: "remove <app> [[secret] | --all] [flags]", Use: "remove <domain> [[secret] | --all] [flags]",
Aliases: []string{"rm"}, Aliases: []string{"rm"},
Short: "Remove a secret", Short: "Remove a secret",
Args: cobra.RangeArgs(1, 2), Args: cobra.RangeArgs(1, 2),
@ -338,7 +338,7 @@ var AppSecretRmCommand = &cobra.Command{
} }
var AppSecretLsCommand = &cobra.Command{ var AppSecretLsCommand = &cobra.Command{
Use: "list <app>", Use: "list <domain>",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Short: "List all secrets", Short: "List all secrets",
Args: cobra.MinimumNArgs(1), Args: cobra.MinimumNArgs(1),

View File

@ -17,7 +17,7 @@ import (
) )
var AppServicesCommand = &cobra.Command{ var AppServicesCommand = &cobra.Command{
Use: "services <app> [flags]", Use: "services <domain> [flags]",
Aliases: []string{"sr"}, Aliases: []string{"sr"},
Short: "Display all services of an app", Short: "Display all services of an app",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),

View File

@ -18,7 +18,7 @@ import (
) )
var AppUndeployCommand = &cobra.Command{ var AppUndeployCommand = &cobra.Command{
Use: "undeploy <app> [flags]", Use: "undeploy <domain> [flags]",
Aliases: []string{"un"}, Aliases: []string{"un"},
Short: "Undeploy an app", Short: "Undeploy an app",
Long: `This does not destroy any application data. Long: `This does not destroy any application data.

View File

@ -22,7 +22,7 @@ import (
) )
var AppUpgradeCommand = &cobra.Command{ var AppUpgradeCommand = &cobra.Command{
Use: "upgrade <app> [version] [flags]", Use: "upgrade <domain> [version] [flags]",
Aliases: []string{"up"}, Aliases: []string{"up"},
Short: "Upgrade an app", Short: "Upgrade an app",
Long: `Upgrade an app. Long: `Upgrade an app.

View File

@ -14,7 +14,7 @@ import (
) )
var AppVolumeListCommand = &cobra.Command{ var AppVolumeListCommand = &cobra.Command{
Use: "list <app> [flags]", Use: "list <domain> [flags]",
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Short: "List volumes associated with an app", Short: "List volumes associated with an app",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
@ -71,12 +71,12 @@ var AppVolumeListCommand = &cobra.Command{
} }
var AppVolumeRemoveCommand = &cobra.Command{ var AppVolumeRemoveCommand = &cobra.Command{
Use: "remove <app> [flags]", Use: "remove <domain> [flags]",
Short: "Remove volume(s) associated with an app", Short: "Remove volume(s) associated with an app",
Long: `Remove volumes associated with an app. Long: `Remove volumes associated with an app.
The app in question must be undeployed before you try to remove volumes. See The app in question must be undeployed before you try to remove volumes. See
"abra app undeploy <app>" for more. "abra app undeploy <domain>" for more.
The command is interactive and will show a multiple select input which allows The command is interactive and will show a multiple select input which allows
you to make a seclection. Use the "?" key to see more help on navigating this you to make a seclection. Use the "?" key to see more help on navigating this

View File

@ -65,7 +65,7 @@ func NewVersionOverview(
upperKind := strings.ToUpper(kind) upperKind := strings.ToUpper(kind)
rows := [][]string{ rows := [][]string{
{"APP", domain}, {"DOMAIN", domain},
{"RECIPE", app.Recipe.Name}, {"RECIPE", app.Recipe.Name},
{"SERVER", server}, {"SERVER", server},
{"CONFIG", deployConfig}, {"CONFIG", deployConfig},
@ -164,7 +164,7 @@ func DeployOverview(
} }
rows := [][]string{ rows := [][]string{
{"APP", domain}, {"DOMAIN", domain},
{"RECIPE", app.Recipe.Name}, {"RECIPE", app.Recipe.Name},
{"SERVER", server}, {"SERVER", server},
{"CONFIG", deployConfig}, {"CONFIG", deployConfig},
@ -244,7 +244,7 @@ func UndeployOverview(
} }
rows := [][]string{ rows := [][]string{
{"APP", domain}, {"DOMAIN", domain},
{"RECIPE", app.Recipe.Name}, {"RECIPE", app.Recipe.Name},
{"SERVER", server}, {"SERVER", server},
{"CONFIG", deployConfig}, {"CONFIG", deployConfig},

View File

@ -15,7 +15,7 @@ func TestEnsureDomainsResolveSameIPv4(t *testing.T) {
}{ }{
// NOTE(d1): DNS records get checked, so use something that is maintained // NOTE(d1): DNS records get checked, so use something that is maintained
// within the federation. if you're here because of a failing test, try // within the federation. if you're here because of a failing test, try
// `dig +short <app>` to ensure stuff matches first! If flakyness // `dig +short <domain>` to ensure stuff matches first! If flakyness
// becomes an issue we can look into mocking // becomes an issue we can look into mocking
{"docs.coopcloud.tech", "swarm-0.coopcloud.tech", true}, {"docs.coopcloud.tech", "swarm-0.coopcloud.tech", true},
{"docs.coopcloud.tech", "coopcloud.tech", true}, {"docs.coopcloud.tech", "coopcloud.tech", true},
@ -43,7 +43,7 @@ func TestEnsureDomainsResolveSameIPv4(t *testing.T) {
func TestEnsureIpv4(t *testing.T) { func TestEnsureIpv4(t *testing.T) {
// NOTE(d1): DNS records get checked, so use something that is maintained // NOTE(d1): DNS records get checked, so use something that is maintained
// within the federation. if you're here because of a failing test, try `dig // within the federation. if you're here because of a failing test, try `dig
// +short <app>` to ensure stuff matches first! If flakyness becomes an // +short <domain>` to ensure stuff matches first! If flakyness becomes an
// issue we can look into mocking // issue we can look into mocking
domainName := "collabora.ostrom.collective.tools" domainName := "collabora.ostrom.collective.tools"
serverName := "ostrom.collective.tools" serverName := "ostrom.collective.tools"