From 1194f3b2288f7352e297cb9ed7df6190715a7308 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Fri, 3 Jan 2025 08:24:03 +0100 Subject: [PATCH] refactor!: maintain "domain" See https://git.coopcloud.tech/toolshed/organising/issues/636 --- cli/app/backup.go | 8 ++++---- cli/app/check.go | 2 +- cli/app/cmd.go | 4 ++-- cli/app/config.go | 2 +- cli/app/cp.go | 2 +- cli/app/deploy.go | 2 +- cli/app/env.go | 2 +- cli/app/labels.go | 2 +- cli/app/logs.go | 2 +- cli/app/new.go | 2 +- cli/app/ps.go | 2 +- cli/app/remove.go | 2 +- cli/app/restart.go | 4 ++-- cli/app/restore.go | 2 +- cli/app/rollback.go | 2 +- cli/app/run.go | 2 +- cli/app/secret.go | 8 ++++---- cli/app/services.go | 2 +- cli/app/undeploy.go | 2 +- cli/app/upgrade.go | 2 +- cli/app/volume.go | 6 +++--- cli/internal/deploy.go | 6 +++--- pkg/dns/dns_test.go | 4 ++-- 23 files changed, 36 insertions(+), 36 deletions(-) diff --git a/cli/app/backup.go b/cli/app/backup.go index df49a145..83083172 100644 --- a/cli/app/backup.go +++ b/cli/app/backup.go @@ -11,7 +11,7 @@ import ( ) var AppBackupListCommand = &cobra.Command{ - Use: "list [flags]", + Use: "list [flags]", Aliases: []string{"ls"}, Short: "List the contents of a snapshot", Args: cobra.ExactArgs(1), @@ -61,7 +61,7 @@ var AppBackupListCommand = &cobra.Command{ } var AppBackupDownloadCommand = &cobra.Command{ - Use: "download [flags]", + Use: "download [flags]", Aliases: []string{"d"}, Short: "Download a snapshot", Long: `Downloads a backup.tar.gz to the current working directory. @@ -130,7 +130,7 @@ var AppBackupDownloadCommand = &cobra.Command{ } var AppBackupCreateCommand = &cobra.Command{ - Use: "create [flags]", + Use: "create [flags]", Aliases: []string{"c"}, Short: "Create a new snapshot", Args: cobra.ExactArgs(1), @@ -174,7 +174,7 @@ var AppBackupCreateCommand = &cobra.Command{ } var AppBackupSnapshotsCommand = &cobra.Command{ - Use: "snapshots [flags]", + Use: "snapshots [flags]", Aliases: []string{"s"}, Short: "List all snapshots", Args: cobra.ExactArgs(1), diff --git a/cli/app/check.go b/cli/app/check.go index 1c42c626..dde31b93 100644 --- a/cli/app/check.go +++ b/cli/app/check.go @@ -13,7 +13,7 @@ import ( ) var AppCheckCommand = &cobra.Command{ - Use: "check [flags]", + Use: "check [flags]", Aliases: []string{"chk"}, Short: "Ensure an app is well configured", Long: `Compare env vars in both the app ".env" and recipe ".env.sample" file. diff --git a/cli/app/cmd.go b/cli/app/cmd.go index 53714548..0aa22e3b 100644 --- a/cli/app/cmd.go +++ b/cli/app/cmd.go @@ -18,7 +18,7 @@ import ( ) var AppCmdCommand = &cobra.Command{ - Use: "command [service | --local] [[args] [flags] | [flags] -- [args]]", + Use: "command [service | --local] [[args] [flags] | [flags] -- [args]]", Aliases: []string{"cmd"}, Short: "Run app commands", Long: `Run an app specific command. @@ -192,7 +192,7 @@ does not).`, } var AppCmdListCommand = &cobra.Command{ - Use: "list [flags]", + Use: "list [flags]", Aliases: []string{"ls"}, Short: "List all available commands", Args: cobra.MinimumNArgs(1), diff --git a/cli/app/config.go b/cli/app/config.go index 670dfdeb..163f1afc 100644 --- a/cli/app/config.go +++ b/cli/app/config.go @@ -12,7 +12,7 @@ import ( ) var AppConfigCommand = &cobra.Command{ - Use: "config [flags]", + Use: "config [flags]", Aliases: []string{"cfg"}, Short: "Edit app config", Example: " abra config 1312.net", diff --git a/cli/app/cp.go b/cli/app/cp.go index f8614f54..ab167167 100644 --- a/cli/app/cp.go +++ b/cli/app/cp.go @@ -26,7 +26,7 @@ import ( ) var AppCpCommand = &cobra.Command{ - Use: "cp [flags]", + Use: "cp [flags]", Aliases: []string{"c"}, Short: "Copy files to/from a deployed app service", Example: ` # copy myfile.txt to the root of the app service diff --git a/cli/app/deploy.go b/cli/app/deploy.go index 39c1bd95..5d91f704 100644 --- a/cli/app/deploy.go +++ b/cli/app/deploy.go @@ -23,7 +23,7 @@ import ( ) var AppDeployCommand = &cobra.Command{ - Use: "deploy [version] [flags]", + Use: "deploy [version] [flags]", Aliases: []string{"d"}, Short: "Deploy an app", Long: `Deploy an app. diff --git a/cli/app/env.go b/cli/app/env.go index d16a87e8..44f3e3fe 100644 --- a/cli/app/env.go +++ b/cli/app/env.go @@ -11,7 +11,7 @@ import ( ) var AppEnvCommand = &cobra.Command{ - Use: "env [flags]", + Use: "env [flags]", Aliases: []string{"e"}, Short: "Show app .env values", Example: " abra app env 1312.net", diff --git a/cli/app/labels.go b/cli/app/labels.go index 6b1d110d..5201db61 100644 --- a/cli/app/labels.go +++ b/cli/app/labels.go @@ -19,7 +19,7 @@ import ( ) var AppLabelsCommand = &cobra.Command{ - Use: "labels [flags]", + Use: "labels [flags]", Aliases: []string{"lb"}, Short: "Show deployment labels", Long: "Both local recipe and live deployment labels are shown.", diff --git a/cli/app/logs.go b/cli/app/logs.go index b0cfa269..b6f2bbb5 100644 --- a/cli/app/logs.go +++ b/cli/app/logs.go @@ -24,7 +24,7 @@ import ( ) var AppLogsCommand = &cobra.Command{ - Use: "logs [service] [flags]", + Use: "logs [service] [flags]", Aliases: []string{"l"}, Short: "Tail app logs", Args: cobra.RangeArgs(1, 2), diff --git a/cli/app/new.go b/cli/app/new.go index 2d9c2566..28a7caed 100644 --- a/cli/app/new.go +++ b/cli/app/new.go @@ -25,7 +25,7 @@ This new app configuration is stored in your $ABRA_DIR directory under the appropriate server. This command does not deploy your app for you. You will need to run "abra app -deploy " to do so. +deploy " to do so. You can see what recipes are available (i.e. values for the [recipe] argument) by running "abra recipe ls". diff --git a/cli/app/ps.go b/cli/app/ps.go index ec28ebe5..88bb7b85 100644 --- a/cli/app/ps.go +++ b/cli/app/ps.go @@ -23,7 +23,7 @@ import ( ) var AppPsCommand = &cobra.Command{ - Use: "ps [flags]", + Use: "ps [flags]", Aliases: []string{"p"}, Short: "Check app deployment status", Args: cobra.ExactArgs(1), diff --git a/cli/app/remove.go b/cli/app/remove.go index b04ec017..9013d771 100644 --- a/cli/app/remove.go +++ b/cli/app/remove.go @@ -16,7 +16,7 @@ import ( ) var AppRemoveCommand = &cobra.Command{ - Use: "remove [flags]", + Use: "remove [flags]", Aliases: []string{"rm"}, Short: "Remove all app data, locally and remotely", Long: `Remove everything related to an app which is already undeployed. diff --git a/cli/app/restart.go b/cli/app/restart.go index d951ea67..eea10397 100644 --- a/cli/app/restart.go +++ b/cli/app/restart.go @@ -15,12 +15,12 @@ import ( ) var AppRestartCommand = &cobra.Command{ - Use: "restart [[service] | --all-services] [flags]", + Use: "restart [[service] | --all-services] [flags]", Aliases: []string{"re"}, Short: "Restart an app", Long: `This command restarts services within a deployed app. -Run "abra app ps " to see a list of service names. +Run "abra app ps " to see a list of service names. Pass "--all-services/-a" to restart all services.`, Example: ` # restart a single app service diff --git a/cli/app/restore.go b/cli/app/restore.go index bb584af9..21b1dcc0 100644 --- a/cli/app/restore.go +++ b/cli/app/restore.go @@ -12,7 +12,7 @@ import ( ) var AppRestoreCommand = &cobra.Command{ - Use: "restore [flags]", + Use: "restore [flags]", Aliases: []string{"rs"}, Short: "Restore a snapshot", Long: `Snapshots are restored while apps are deployed. diff --git a/cli/app/rollback.go b/cli/app/rollback.go index a049d29b..9213562d 100644 --- a/cli/app/rollback.go +++ b/cli/app/rollback.go @@ -21,7 +21,7 @@ import ( ) var AppRollbackCommand = &cobra.Command{ - Use: "rollback [version] [flags]", + Use: "rollback [version] [flags]", Aliases: []string{"rl"}, Short: "Roll an app back to a previous version", Long: `This command rolls an app back to a previous version. diff --git a/cli/app/run.go b/cli/app/run.go index a6210aa0..637531ed 100644 --- a/cli/app/run.go +++ b/cli/app/run.go @@ -17,7 +17,7 @@ import ( ) var AppRunCommand = &cobra.Command{ - Use: "run [[args] [flags] | [flags] -- [args]]", + Use: "run [[args] [flags] | [flags] -- [args]]", Aliases: []string{"r"}, Short: "Run a command inside a service container", Example: ` # run with args/flags diff --git a/cli/app/secret.go b/cli/app/secret.go index 2018e14f..faf8d320 100644 --- a/cli/app/secret.go +++ b/cli/app/secret.go @@ -20,7 +20,7 @@ import ( ) var AppSecretGenerateCommand = &cobra.Command{ - Use: "generate [[secret] [version] | --all] [flags]", + Use: "generate [[secret] [version] | --all] [flags]", Aliases: []string{"g"}, Short: "Generate secrets", Args: cobra.RangeArgs(1, 3), @@ -140,7 +140,7 @@ var AppSecretGenerateCommand = &cobra.Command{ } var AppSecretInsertCommand = &cobra.Command{ - Use: "insert [flags]", + Use: "insert [flags]", Aliases: []string{"i"}, Short: "Insert secret", 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{ - Use: "remove [[secret] | --all] [flags]", + Use: "remove [[secret] | --all] [flags]", Aliases: []string{"rm"}, Short: "Remove a secret", Args: cobra.RangeArgs(1, 2), @@ -338,7 +338,7 @@ var AppSecretRmCommand = &cobra.Command{ } var AppSecretLsCommand = &cobra.Command{ - Use: "list ", + Use: "list ", Aliases: []string{"ls"}, Short: "List all secrets", Args: cobra.MinimumNArgs(1), diff --git a/cli/app/services.go b/cli/app/services.go index f356d020..a49eba9c 100644 --- a/cli/app/services.go +++ b/cli/app/services.go @@ -17,7 +17,7 @@ import ( ) var AppServicesCommand = &cobra.Command{ - Use: "services [flags]", + Use: "services [flags]", Aliases: []string{"sr"}, Short: "Display all services of an app", Args: cobra.ExactArgs(1), diff --git a/cli/app/undeploy.go b/cli/app/undeploy.go index 7d761107..4fa1f499 100644 --- a/cli/app/undeploy.go +++ b/cli/app/undeploy.go @@ -18,7 +18,7 @@ import ( ) var AppUndeployCommand = &cobra.Command{ - Use: "undeploy [flags]", + Use: "undeploy [flags]", Aliases: []string{"un"}, Short: "Undeploy an app", Long: `This does not destroy any application data. diff --git a/cli/app/upgrade.go b/cli/app/upgrade.go index 89257d02..6d8ec37c 100644 --- a/cli/app/upgrade.go +++ b/cli/app/upgrade.go @@ -22,7 +22,7 @@ import ( ) var AppUpgradeCommand = &cobra.Command{ - Use: "upgrade [version] [flags]", + Use: "upgrade [version] [flags]", Aliases: []string{"up"}, Short: "Upgrade an app", Long: `Upgrade an app. diff --git a/cli/app/volume.go b/cli/app/volume.go index 9813ba84..a78bb65e 100644 --- a/cli/app/volume.go +++ b/cli/app/volume.go @@ -14,7 +14,7 @@ import ( ) var AppVolumeListCommand = &cobra.Command{ - Use: "list [flags]", + Use: "list [flags]", Aliases: []string{"ls"}, Short: "List volumes associated with an app", Args: cobra.ExactArgs(1), @@ -71,12 +71,12 @@ var AppVolumeListCommand = &cobra.Command{ } var AppVolumeRemoveCommand = &cobra.Command{ - Use: "remove [flags]", + Use: "remove [flags]", Short: "Remove volume(s) 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 -"abra app undeploy " for more. +"abra app undeploy " for more. 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 diff --git a/cli/internal/deploy.go b/cli/internal/deploy.go index 8bbcc6c3..3d895128 100644 --- a/cli/internal/deploy.go +++ b/cli/internal/deploy.go @@ -65,7 +65,7 @@ func NewVersionOverview( upperKind := strings.ToUpper(kind) rows := [][]string{ - {"APP", domain}, + {"DOMAIN", domain}, {"RECIPE", app.Recipe.Name}, {"SERVER", server}, {"CONFIG", deployConfig}, @@ -164,7 +164,7 @@ func DeployOverview( } rows := [][]string{ - {"APP", domain}, + {"DOMAIN", domain}, {"RECIPE", app.Recipe.Name}, {"SERVER", server}, {"CONFIG", deployConfig}, @@ -244,7 +244,7 @@ func UndeployOverview( } rows := [][]string{ - {"APP", domain}, + {"DOMAIN", domain}, {"RECIPE", app.Recipe.Name}, {"SERVER", server}, {"CONFIG", deployConfig}, diff --git a/pkg/dns/dns_test.go b/pkg/dns/dns_test.go index 18ab06b6..a1d1a060 100644 --- a/pkg/dns/dns_test.go +++ b/pkg/dns/dns_test.go @@ -15,7 +15,7 @@ func TestEnsureDomainsResolveSameIPv4(t *testing.T) { }{ // 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 +short ` to ensure stuff matches first! If flakyness + // `dig +short ` to ensure stuff matches first! If flakyness // becomes an issue we can look into mocking {"docs.coopcloud.tech", "swarm-0.coopcloud.tech", true}, {"docs.coopcloud.tech", "coopcloud.tech", true}, @@ -43,7 +43,7 @@ func TestEnsureDomainsResolveSameIPv4(t *testing.T) { func TestEnsureIpv4(t *testing.T) { // 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 - // +short ` to ensure stuff matches first! If flakyness becomes an + // +short ` to ensure stuff matches first! If flakyness becomes an // issue we can look into mocking domainName := "collabora.ostrom.collective.tools" serverName := "ostrom.collective.tools"