aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/internal/cli
diff options
context:
space:
mode:
Diffstat (limited to 'client/go/internal/cli')
-rw-r--r--client/go/internal/cli/cmd/prod.go15
-rw-r--r--client/go/internal/cli/cmd/prod_test.go20
-rw-r--r--client/go/internal/cli/cmd/root.go2
3 files changed, 21 insertions, 16 deletions
diff --git a/client/go/internal/cli/cmd/prod.go b/client/go/internal/cli/cmd/prod.go
index f322bd667df..49ca9d46c6c 100644
--- a/client/go/internal/cli/cmd/prod.go
+++ b/client/go/internal/cli/cmd/prod.go
@@ -27,7 +27,7 @@ func newProdCmd() *cobra.Command {
Configure and deploy your application package to production in Vespa Cloud.`,
Example: `$ vespa prod init
-$ vespa prod submit`,
+$ vespa prod deploy`,
DisableAutoGenTag: true,
SilenceUsage: false,
Args: cobra.MinimumNArgs(1),
@@ -102,11 +102,12 @@ https://cloud.vespa.ai/en/reference/deployment`,
}
}
-func newProdSubmitCmd(cli *CLI) *cobra.Command {
+func newProdDeployCmd(cli *CLI) *cobra.Command {
return &cobra.Command{
- Use: "submit",
- Short: "Submit an application for production deployment",
- Long: `Submit an application for production deployment.
+ Use: "deploy",
+ Aliases: []string{"submit"}, // TODO: Remove in Vespa 9
+ Short: "Deploy an application to production",
+ Long: `Deploy an application to production.
This commands uploads an application package to Vespa Cloud and deploys it to
the production zones specified in deployment.xml.
@@ -120,7 +121,7 @@ https://cloud.vespa.ai/en/automated-deployments`,
DisableAutoGenTag: true,
SilenceUsage: true,
Example: `$ mvn package # when adding custom Java components
-$ vespa prod submit`,
+$ vespa prod deploy`,
RunE: func(cmd *cobra.Command, args []string) error {
target, err := cli.target(targetOptions{noCertificate: true})
if err != nil {
@@ -128,7 +129,7 @@ $ vespa prod submit`,
}
if target.Type() != vespa.TargetCloud {
// TODO: Add support for hosted
- return fmt.Errorf("prod submit does not support %s target", target.Type())
+ return fmt.Errorf("prod deploy does not support %s target", target.Type())
}
pkg, err := cli.applicationPackageFrom(args, true)
if err != nil {
diff --git a/client/go/internal/cli/cmd/prod_test.go b/client/go/internal/cli/cmd/prod_test.go
index b04e7861080..9ca325c12ff 100644
--- a/client/go/internal/cli/cmd/prod_test.go
+++ b/client/go/internal/cli/cmd/prod_test.go
@@ -149,19 +149,19 @@ func writeTest(path string, content []byte, t *testing.T) {
}
}
-func TestProdSubmit(t *testing.T) {
+func TestProdDeploy(t *testing.T) {
pkgDir := filepath.Join(t.TempDir(), "app")
createApplication(t, pkgDir, false, false)
- prodSubmit(pkgDir, t)
+ prodDeploy(pkgDir, t)
}
-func TestProdSubmitWithoutTests(t *testing.T) {
+func TestProdDeployWithoutTests(t *testing.T) {
pkgDir := filepath.Join(t.TempDir(), "app")
createApplication(t, pkgDir, false, true)
- prodSubmit(pkgDir, t)
+ prodDeploy(pkgDir, t)
}
-func prodSubmit(pkgDir string, t *testing.T) {
+func prodDeploy(pkgDir string, t *testing.T) {
t.Helper()
httpClient := &mock.HTTPClient{}
httpClient.NextResponseString(200, `ok`)
@@ -198,12 +198,16 @@ func prodSubmit(pkgDir string, t *testing.T) {
stdout.Reset()
cli.Environment["VESPA_CLI_API_KEY_FILE"] = filepath.Join(cli.config.homeDir, "t1.api-key.pem")
- assert.Nil(t, cli.Run("prod", "submit"))
+ assert.Nil(t, cli.Run("prod", "deploy"))
+ assert.Contains(t, stdout.String(), "Success: Submitted")
+ assert.Contains(t, stdout.String(), "See https://console.vespa-cloud.com/tenant/t1/application/a1/prod/deployment for deployment progress")
+ stdout.Reset()
+ assert.Nil(t, cli.Run("prod", "submit")) // old variant also works
assert.Contains(t, stdout.String(), "Success: Submitted")
assert.Contains(t, stdout.String(), "See https://console.vespa-cloud.com/tenant/t1/application/a1/prod/deployment for deployment progress")
}
-func TestProdSubmitWithJava(t *testing.T) {
+func TestProdDeployWithJava(t *testing.T) {
pkgDir := filepath.Join(t.TempDir(), "app")
createApplication(t, pkgDir, true, false)
@@ -230,7 +234,7 @@ func TestProdSubmitWithJava(t *testing.T) {
assert.Contains(t, stdout.String(), "See https://console.vespa-cloud.com/tenant/t1/application/a1/prod/deployment for deployment progress")
}
-func TestProdSubmitInvalidZip(t *testing.T) {
+func TestProdDeployInvalidZip(t *testing.T) {
pkgDir := filepath.Join(t.TempDir(), "app")
createApplication(t, pkgDir, true, false)
diff --git a/client/go/internal/cli/cmd/root.go b/client/go/internal/cli/cmd/root.go
index 88d43411983..1b37ff00269 100644
--- a/client/go/internal/cli/cmd/root.go
+++ b/client/go/internal/cli/cmd/root.go
@@ -257,7 +257,7 @@ func (c *CLI) configureCommands() {
rootCmd.AddCommand(newLogCmd(c)) // log
rootCmd.AddCommand(newManCmd(c)) // man
prodCmd.AddCommand(newProdInitCmd(c)) // prod init
- prodCmd.AddCommand(newProdSubmitCmd(c)) // prod submit
+ prodCmd.AddCommand(newProdDeployCmd(c)) // prod deploy
rootCmd.AddCommand(prodCmd) // prod
rootCmd.AddCommand(newQueryCmd(c)) // query
statusCmd.AddCommand(newStatusQueryCmd(c)) // status query