aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorKristian Aune <kkraune@users.noreply.github.com>2023-04-27 14:21:11 +0200
committerGitHub <noreply@github.com>2023-04-27 14:21:11 +0200
commit737b057f2a5c40487866c47c8eacec460ef76596 (patch)
tree2fa359b69463f8159871d8540de2008e293e22da /client
parent8e4c9b52ee8bbc2983c38a97f818dc7c8d706154 (diff)
parent92ba6dc980cb5e8f8d5ad0caec2067e7a075f150 (diff)
Merge pull request #26885 from vespa-engine/mpolden/prod-deploy
Rename prod submit to prod deploy
Diffstat (limited to 'client')
-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
-rw-r--r--client/go/internal/vespa/deploy.go2
4 files changed, 22 insertions, 17 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
diff --git a/client/go/internal/vespa/deploy.go b/client/go/internal/vespa/deploy.go
index f633c8ed9ee..d612a3647d7 100644
--- a/client/go/internal/vespa/deploy.go
+++ b/client/go/internal/vespa/deploy.go
@@ -261,7 +261,7 @@ func Submit(opts DeploymentOptions) error {
Header: make(http.Header),
}
request.Header.Set("Content-Type", writer.FormDataContentType())
- serviceDescription := "Submit service"
+ serviceDescription := "Deploy service"
response, err := deployServiceDo(request, time.Minute*10, opts)
if err != nil {
return err