mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-19 04:26:39 +00:00
rename 'vela comp run' to 'vela comp deploy'
This commit is contained in:
+1
-1
@@ -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
|
||||
```
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 <workload-type>
|
||||
vela comp deploy -t <workload-type>
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -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 <workload-type>",
|
||||
Example: "vela comp deploy -t <workload-type>",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if len(args) == 0 || args[0] == "-h" {
|
||||
err := cmd.Help()
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user