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

Commit 4d45793

Browse files
author
Faris Huskovic
committed
Trail build logs if follow enabled for envs edit
1 parent 9392b25 commit 4d45793

16 files changed

+82
-74
lines changed

docs/coder.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
coder provides a CLI for working with an existing Coder Enterprise installation
44

5-
### Synopsis
6-
7-
coder provides a CLI for working with an existing Coder Enterprise installation
8-
95
### Options
106

117
```

docs/coder_login.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Authenticate this client for future operations
44

5-
### Synopsis
6-
7-
Authenticate this client for future operations
8-
95
```
106
coder login [Coder Enterprise URL eg. https://my.coder.domain/] [flags]
117
```

docs/coder_logout.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Remove local authentication credentials if any exist
44

5-
### Synopsis
6-
7-
Remove local authentication credentials if any exist
8-
95
```
106
coder logout [flags]
117
```

docs/coder_secrets_ls.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
List all secrets owned by the active user
44

5-
### Synopsis
6-
7-
List all secrets owned by the active user
8-
95
```
106
coder secrets ls [flags]
117
```

docs/coder_secrets_rm.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Remove one or more secrets by name
44

5-
### Synopsis
6-
7-
Remove one or more secrets by name
8-
95
```
106
coder secrets rm [...secret_name] [flags]
117
```

docs/coder_secrets_view.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
View a secret by name
44

5-
### Synopsis
6-
7-
View a secret by name
8-
95
```
106
coder secrets view [secret_name] [flags]
117
```

docs/coder_sync.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Establish a one way directory sync to a Coder environment
44

5-
### Synopsis
6-
7-
Establish a one way directory sync to a Coder environment
8-
95
```
106
coder sync [local directory] [<env name>:<remote directory>] [flags]
117
```

docs/coder_urls.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Interact with environment DevURLs
44

5-
### Synopsis
6-
7-
Interact with environment DevURLs
8-
95
### Options
106

117
```

docs/coder_urls_create.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Create a new devurl for an environment
44

5-
### Synopsis
6-
7-
Create a new devurl for an environment
8-
95
```
106
coder urls create [env_name] [port] [--access <level>] [--name <name>] [flags]
117
```

docs/coder_urls_ls.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
List all DevURLs for an environment
44

5-
### Synopsis
6-
7-
List all DevURLs for an environment
8-
95
```
106
coder urls ls [environment_name] [flags]
117
```

docs/coder_urls_rm.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Remove a dev url
44

5-
### Synopsis
6-
7-
Remove a dev url
8-
95
```
106
coder urls rm [environment_name] [port] [flags]
117
```

docs/coder_users.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Interact with Coder user accounts
44

5-
### Synopsis
6-
7-
Interact with Coder user accounts
8-
95
### Options
106

117
```

docs/coder_users_ls.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
list all user accounts
44

5-
### Synopsis
6-
7-
list all user accounts
8-
95
```
106
coder users ls [flags]
117
```

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ require (
77
cdr.dev/wsep v0.0.0-20200728013649-82316a09813f
88
github.com/briandowns/spinner v1.11.1
99
github.com/fatih/color v1.9.0
10-
github.com/gorilla/websocket v1.4.1
10+
github.com/gorilla/websocket v1.4.2
1111
github.com/kirsle/configdir v0.0.0-20170128060238-e45d2f54772f
1212
github.com/klauspost/compress v1.10.8 // indirect
1313
github.com/manifoldco/promptui v0.7.0
1414
github.com/mattn/go-colorable v0.1.8 // indirect
1515
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
1616
github.com/rjeczalik/notify v0.9.2
17-
github.com/spf13/cobra v1.0.0
17+
github.com/spf13/cobra v1.1.1
1818
github.com/stretchr/testify v1.6.1
1919
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
2020
golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect

go.sum

+64-12
Large diffs are not rendered by default.

internal/cmd/envs.go

+16-8
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,18 @@ coder envs create --cpu 4 --disk 100 --memory 8 --image 5f443b16-30652892427b955
183183
return xerrors.Errorf("create environment: %w", err)
184184
}
185185

186-
clog.LogSuccess(
187-
"creating environment...",
188-
clog.BlankLine,
189-
clog.Tipf(`run "coder envs watch-build %q" to trail the build logs`, args[0]),
190-
)
191-
192186
if follow {
187+
clog.LogSuccess("creating environment...")
193188
if err := trailBuildLogs(cmd.Context(), client, env.ID); err != nil {
194189
return err
195190
}
191+
return nil
196192
}
193+
194+
clog.LogSuccess("creating environment...",
195+
clog.BlankLine,
196+
clog.Tipf(`run "coder envs watch-build %q" to trail the build logs`, env.Name),
197+
)
197198
return nil
198199
},
199200
}
@@ -293,8 +294,15 @@ coder envs edit back-end-env --disk 20`,
293294
return xerrors.Errorf("failed to apply changes to environment: '%s'", envName)
294295
}
295296

296-
clog.LogSuccess(
297-
"applied changes to the environment, rebuilding...",
297+
if follow {
298+
clog.LogSuccess("applied changes to the environment, rebuilding...")
299+
if err := trailBuildLogs(cmd.Context(), client, env.ID); err != nil {
300+
return err
301+
}
302+
return nil
303+
}
304+
305+
clog.LogSuccess("applied changes to the environment, rebuilding...",
298306
clog.BlankLine,
299307
clog.Tipf(`run "coder envs watch-build %q" to trail the build logs`, envName),
300308
)

0 commit comments

Comments
 (0)