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

Commit

Permalink
chore: Unhide create-from-config (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreya authored Mar 30, 2021
1 parent c4d9c0e commit 9ebec49
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/coder_envs.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Perform operations on the Coder environments owned by the active user.

* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation
* [coder envs create](coder_envs_create.md) - create a new environment.
* [coder envs create-from-config](coder_envs_create-from-config.md) - create a new environment from a template
* [coder envs edit](coder_envs_edit.md) - edit an existing environment and initiate a rebuild.
* [coder envs ls](coder_envs_ls.md) - list all environments owned by the active user
* [coder envs rebuild](coder_envs_rebuild.md) - rebuild a Coder environment
Expand Down
43 changes: 43 additions & 0 deletions docs/coder_envs_create-from-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## coder envs create-from-config

create a new environment from a template

### Synopsis

Create a new Coder environment using a Workspaces As Code template.

```
coder envs create-from-config [flags]
```

### Examples

```
# create a new environment from git repository
coder envs create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch
coder envs create-from-config --name="dev-env" -f coder.yaml
```

### Options

```
-f, --filepath string path to local template file.
--follow follow buildlog after initiating rebuild
-h, --help help for create-from-config
--name string name of the environment to be created
-o, --org string name of the organization the environment should be created under.
--provider string name of Workspace Provider with which to create the environment
--ref string git reference to pull template from. May be a branch, tag, or commit hash. (default "master")
-r, --repo-url string URL of the git repository to pull the config from. Config file must live in '.coder/coder.yaml'.
```

### Options inherited from parent commands

```
-v, --verbose show verbose output
```

### SEE ALSO

* [coder envs](coder_envs.md) - Interact with Coder environments

15 changes: 7 additions & 8 deletions internal/cmd/envs.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func envsCmd() *cobra.Command {
watchBuildLogCommand(),
rebuildEnvCommand(),
createEnvCmd(),
createEnvFromRepoCmd(),
createEnvFromConfigCmd(),
editEnvCmd(),
)
return cmd
Expand Down Expand Up @@ -291,7 +291,7 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
return cmd
}

func createEnvFromRepoCmd() *cobra.Command {
func createEnvFromConfigCmd() *cobra.Command {
var (
ref string
repo string
Expand All @@ -303,12 +303,11 @@ func createEnvFromRepoCmd() *cobra.Command {
)

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

0 comments on commit 9ebec49

Please sign in to comment.