diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d36c78fb..6430ac135 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,7 @@ vela env init myenv --namespace myenv --email my@email.com --domain kubevela.io For example, use the following command to create and run an application. ```shell script -$ vela comp run mycomp -t webservice --image crccheck/hello-world --port 8000 +$ vela comp deploy mycomp -t webservice --image crccheck/hello-world --port 8000 Creating AppConfig appcomp SUCCEED ``` diff --git a/README.md b/README.md index c9347de8d..5dd890d6f 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ $ cat ~/.vela/envs/demo/config.json Then let's create application, we will use the `demo` environment. ```console -$ vela comp run mycomp -t webservice --image crccheck/hello-world --port 8000 --app myapp +$ vela comp deploy mycomp -t webservice --image crccheck/hello-world --port 8000 --app myapp Creating AppConfig appcomp SUCCEED ``` @@ -107,7 +107,7 @@ SUCCEED Vela supports micro-services application by default thanks to Open Application Model. ```console -$ vela comp run db -t backend --image crccheck/hello-world --app myapp +$ vela comp deploy db -t backend --image crccheck/hello-world --app myapp Creating App myapp SUCCEED ``` diff --git a/documentation/cli/vela_comp.md b/documentation/cli/vela_comp.md index fbaf97b24..81c9623cd 100644 --- a/documentation/cli/vela_comp.md +++ b/documentation/cli/vela_comp.md @@ -24,7 +24,7 @@ Manage Components * [vela](vela.md) - * [vela comp delete](vela_comp_delete.md) - Delete Component From Application * [vela comp ls](vela_comp_ls.md) - List applications -* [vela comp run](vela_comp_run.md) - Init and Run workloads +* [vela comp deploy](vela_comp_run.md) - Init and Run workloads * [vela comp show](vela_comp_show.md) - get component detail * [vela comp status](vela_comp_status.md) - get status of a component diff --git a/documentation/cli/vela_comp_run.md b/documentation/cli/vela_comp_run.md index a90d5bc3f..d7c1b3101 100644 --- a/documentation/cli/vela_comp_run.md +++ b/documentation/cli/vela_comp_run.md @@ -1,4 +1,4 @@ -## vela comp run +## vela comp deploy Init and Run workloads @@ -7,13 +7,13 @@ Init and Run workloads Init and Run workloads ``` -vela comp run [args] +vela comp deploy [args] ``` ### Examples ``` -vela comp run -t +vela comp deploy -t ``` ### Options diff --git a/e2e/application/application_test.go b/e2e/application/application_test.go index 30fe2a32d..7c57c37f7 100644 --- a/e2e/application/application_test.go +++ b/e2e/application/application_test.go @@ -20,7 +20,7 @@ var _ = ginkgo.Describe("Application", func() { e2e.DeleteEnvFunc("env delete", envName) e2e.EnvInitContext("env init", envName) e2e.EnvSetContext("env set", envName) - e2e.WorkloadRunContext("run", fmt.Sprintf("vela comp run -t %s %s -p 80 --image nginx:1.9.4", + e2e.WorkloadRunContext("deploy", fmt.Sprintf("vela comp deploy -t %s %s -p 80 --image nginx:1.9.4", workloadType, applicationName)) e2e.ComponentListContext("comp ls", applicationName, "") e2e.TraitManualScalerAttachContext("vela attach scale trait", traitAlias, applicationName) diff --git a/e2e/commonContext.go b/e2e/commonContext.go index 606e0e339..44d68a5d4 100644 --- a/e2e/commonContext.go +++ b/e2e/commonContext.go @@ -124,7 +124,7 @@ var ( }) } - //WorkloadRunContext used for test vela comp run + //WorkloadRunContext used for test vela comp deploy WorkloadRunContext = func(context string, cli string) bool { return ginkgo.Context(context, func() { ginkgo.It("should print successful creation information", func() { diff --git a/e2e/trait/trait_test.go b/e2e/trait/trait_test.go index a7c3eaac4..9688be9ea 100644 --- a/e2e/trait/trait_test.go +++ b/e2e/trait/trait_test.go @@ -20,7 +20,7 @@ var _ = ginkgo.Describe("Trait", func() { e2e.RefreshContext("refresh") e2e.EnvInitContext("env init", envName) e2e.EnvSetContext("env set", envName) - e2e.WorkloadRunContext("run", fmt.Sprintf("vela comp run -t webservice %s -p 80 --image nginx:1.9.4", applicationName)) + e2e.WorkloadRunContext("deploy", fmt.Sprintf("vela comp deploy -t webservice %s -p 80 --image nginx:1.9.4", applicationName)) e2e.TraitManualScalerAttachContext("vela attach trait", traitAlias, applicationName) diff --git a/e2e/workload/workload_test.go b/e2e/workload/workload_test.go index e04977491..6ec6531a7 100644 --- a/e2e/workload/workload_test.go +++ b/e2e/workload/workload_test.go @@ -18,11 +18,11 @@ var _ = ginkgo.Describe("Workload", func() { e2e.RefreshContext("refresh") e2e.EnvInitContext("env init", envName) e2e.EnvSetContext("env set", envName) - e2e.WorkloadRunContext("run", fmt.Sprintf("vela comp run -t webservice %s -p 80 --image nginx:1.9.4", applicationName)) + e2e.WorkloadRunContext("deploy", fmt.Sprintf("vela comp deploy -t webservice %s -p 80 --image nginx:1.9.4", applicationName)) ginkgo.Context("run without enough flags", func() { ginkgo.It("should throw error message: some flags are NOT set", func() { - cli := fmt.Sprintf("vela comp run -t webservice %s -p 80", notEnoughFlagsApplicationName) + cli := fmt.Sprintf("vela comp deploy -t webservice %s -p 80", notEnoughFlagsApplicationName) output, err := e2e.Exec(cli) gomega.Expect(err).NotTo(gomega.HaveOccurred()) gomega.Expect(output).To(gomega.ContainSubstring("required flag(s) \"image\" not set")) diff --git a/pkg/commands/comp.go b/pkg/commands/comp.go index 7aaeb7875..d7a74661d 100644 --- a/pkg/commands/comp.go +++ b/pkg/commands/comp.go @@ -40,7 +40,7 @@ func AddCompCommands(c types.Args, ioStreams util.IOStreams) *cobra.Command { compCommands.AddCommand( NewCompListCommand(c, ioStreams), - NewCompRunCommands(c, ioStreams), + NewCompDeployCommands(c, ioStreams), NewCompShowCommand(ioStreams), NewCompStatusCommand(c, ioStreams), NewCompDeleteCommand(c, ioStreams), @@ -48,15 +48,15 @@ func AddCompCommands(c types.Args, ioStreams util.IOStreams) *cobra.Command { return compCommands } -func NewCompRunCommands(c types.Args, ioStreams util.IOStreams) *cobra.Command { +func NewCompDeployCommands(c types.Args, ioStreams util.IOStreams) *cobra.Command { runCmd := &cobra.Command{ - Use: "run [args]", + Use: "deploy [args]", DisableFlagsInUseLine: true, // Dynamic flag parse in compeletion DisableFlagParsing: true, Short: "Init and Run workloads", Long: "Init and Run workloads", - Example: "vela comp run -t ", + Example: "vela comp deploy -t ", RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 || args[0] == "-h" { err := cmd.Help() diff --git a/pkg/commands/ls.go b/pkg/commands/ls.go index 7c1501669..bbed15116 100644 --- a/pkg/commands/ls.go +++ b/pkg/commands/ls.go @@ -95,7 +95,7 @@ func printComponentList(ctx context.Context, c client.Client, appName string, en Namespace: env.Namespace, }) if err != nil { - ioStreams.Infof("listing Trait DefinitionPath hit an issue: %s\n", err) + ioStreams.Infof("listing Components: %s\n", err) return } all := mergeStagingComponents(deployedComponentList, env, ioStreams)