Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 9ebec49

Browse files
authored
chore: Unhide create-from-config (#306)
1 parent c4d9c0e commit 9ebec49

File tree

3 files changed

+51
-8
lines changed

3 files changed

+51
-8
lines changed

docs/coder_envs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Perform operations on the Coder environments owned by the active user.
2222

2323
* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation
2424
* [coder envs create](coder_envs_create.md) - create a new environment.
25+
* [coder envs create-from-config](coder_envs_create-from-config.md) - create a new environment from a template
2526
* [coder envs edit](coder_envs_edit.md) - edit an existing environment and initiate a rebuild.
2627
* [coder envs ls](coder_envs_ls.md) - list all environments owned by the active user
2728
* [coder envs rebuild](coder_envs_rebuild.md) - rebuild a Coder environment

docs/coder_envs_create-from-config.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## coder envs create-from-config
2+
3+
create a new environment from a template
4+
5+
### Synopsis
6+
7+
Create a new Coder environment using a Workspaces As Code template.
8+
9+
```
10+
coder envs create-from-config [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
# create a new environment from git repository
17+
coder envs create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch
18+
coder envs create-from-config --name="dev-env" -f coder.yaml
19+
```
20+
21+
### Options
22+
23+
```
24+
-f, --filepath string path to local template file.
25+
--follow follow buildlog after initiating rebuild
26+
-h, --help help for create-from-config
27+
--name string name of the environment to be created
28+
-o, --org string name of the organization the environment should be created under.
29+
--provider string name of Workspace Provider with which to create the environment
30+
--ref string git reference to pull template from. May be a branch, tag, or commit hash. (default "master")
31+
-r, --repo-url string URL of the git repository to pull the config from. Config file must live in '.coder/coder.yaml'.
32+
```
33+
34+
### Options inherited from parent commands
35+
36+
```
37+
-v, --verbose show verbose output
38+
```
39+
40+
### SEE ALSO
41+
42+
* [coder envs](coder_envs.md) - Interact with Coder environments
43+

internal/cmd/envs.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func envsCmd() *cobra.Command {
3636
watchBuildLogCommand(),
3737
rebuildEnvCommand(),
3838
createEnvCmd(),
39-
createEnvFromRepoCmd(),
39+
createEnvFromConfigCmd(),
4040
editEnvCmd(),
4141
)
4242
return cmd
@@ -291,7 +291,7 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
291291
return cmd
292292
}
293293

294-
func createEnvFromRepoCmd() *cobra.Command {
294+
func createEnvFromConfigCmd() *cobra.Command {
295295
var (
296296
ref string
297297
repo string
@@ -303,12 +303,11 @@ func createEnvFromRepoCmd() *cobra.Command {
303303
)
304304

305305
cmd := &cobra.Command{
306-
Use: "create-from-config",
307-
Short: "create a new environment from a config file.",
308-
Long: "Create a new Coder environment from a config file.",
309-
Hidden: true,
310-
Example: `# create a new environment from git repository template
311-
coder envs create-from-config --name="dev-env" --repo-url github.com/cdr/m --ref my-branch
306+
Use: "create-from-config",
307+
Short: "create a new environment from a template",
308+
Long: "Create a new Coder environment using a Workspaces As Code template.",
309+
Example: `# create a new environment from git repository
310+
coder envs create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch
312311
coder envs create-from-config --name="dev-env" -f coder.yaml`,
313312
RunE: func(cmd *cobra.Command, args []string) error {
314313
ctx := cmd.Context()

0 commit comments

Comments
 (0)