Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitcd50b33

Browse files
authored
Unhide rebuild and watch-build subcommands (#161)
1 parentcb3ac49 commitcd50b33

File tree

5 files changed

+79
-11
lines changed

5 files changed

+79
-11
lines changed

‎docs/coder_envs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ Perform operations on the Coder environments owned by the active user.
2323

2424
*[coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation
2525
*[coder envs ls](coder_envs_ls.md) - list all environments owned by the active user
26+
*[coder envs rebuild](coder_envs_rebuild.md) - rebuild a Coder environment
2627
*[coder envs stop](coder_envs_stop.md) - stop Coder environments by name
28+
*[coder envs watch-build](coder_envs_watch-build.md) - trail the build log of a Coder environment
2729

‎docs/coder_envs_rebuild.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
##coder envs rebuild
2+
3+
rebuild a Coder environment
4+
5+
```
6+
coder envs rebuild [environment_name] [flags]
7+
```
8+
9+
###Examples
10+
11+
```
12+
coder envs rebuild front-end-env --follow
13+
coder envs rebuild backend-env --force
14+
```
15+
16+
###Options
17+
18+
```
19+
--follow follow build log after initiating rebuild
20+
--force force rebuild without showing a confirmation prompt
21+
-h, --help help for rebuild
22+
```
23+
24+
###Options inherited from parent commands
25+
26+
```
27+
--user string Specify the user whose resources to target (default "me")
28+
-v, --verbose show verbose output
29+
```
30+
31+
###SEE ALSO
32+
33+
*[coder envs](coder_envs.md) - Interact with Coder environments
34+

‎docs/coder_envs_watch-build.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
##coder envs watch-build
2+
3+
trail the build log of a Coder environment
4+
5+
```
6+
coder envs watch-build [environment_name] [flags]
7+
```
8+
9+
###Examples
10+
11+
```
12+
coder envs watch-build front-end-env
13+
```
14+
15+
###Options
16+
17+
```
18+
-h, --help help for watch-build
19+
```
20+
21+
###Options inherited from parent commands
22+
23+
```
24+
--user string Specify the user whose resources to target (default "me")
25+
-v, --verbose show verbose output
26+
```
27+
28+
###SEE ALSO
29+
30+
*[coder envs](coder_envs.md) - Interact with Coder environments
31+

‎internal/cmd/envs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ func envsCommand() *cobra.Command {
3030
lsEnvsCommand(&user),
3131
stopEnvsCommand(&user),
3232
rmEnvsCommand(&user),
33-
watchBuildLogCommand(),
34-
rebuildEnvCommand(),
33+
watchBuildLogCommand(&user),
34+
rebuildEnvCommand(&user),
3535
createEnvCommand(&user),
3636
editEnvCommand(&user),
3737
)

‎internal/cmd/rebuild.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"golang.org/x/xerrors"
1818
)
1919

20-
funcrebuildEnvCommand()*cobra.Command {
20+
funcrebuildEnvCommand(user*string)*cobra.Command {
2121
varfollowbool
2222
varforcebool
2323
cmd:=&cobra.Command{
@@ -26,14 +26,13 @@ func rebuildEnvCommand() *cobra.Command {
2626
Args:cobra.ExactArgs(1),
2727
Example:`coder envs rebuild front-end-env --follow
2828
coder envs rebuild backend-env --force`,
29-
Hidden:true,// TODO(@cmoog) un-hide
3029
RunE:func(cmd*cobra.Command,args []string)error {
3130
ctx:=cmd.Context()
3231
client,err:=newClient()
3332
iferr!=nil {
3433
returnerr
3534
}
36-
env,err:=findEnv(ctx,client,args[0],coder.Me)
35+
env,err:=findEnv(ctx,client,args[0],*user)
3736
iferr!=nil {
3837
returnerr
3938
}
@@ -44,7 +43,10 @@ coder envs rebuild backend-env --force`,
4443
IsConfirm:true,
4544
}).Run()
4645
iferr!=nil {
47-
returnerr
46+
returnclog.Fatal(
47+
"failed to confirm prompt",clog.BlankLine,
48+
clog.Tipf(`use "--force" to rebuild without a confirmation prompt`),
49+
)
4850
}
4951
}
5052

@@ -65,7 +67,7 @@ coder envs rebuild backend-env --force`,
6567
},
6668
}
6769

68-
cmd.Flags().BoolVar(&follow,"follow",false,"followbuildlog after initiating rebuild")
70+
cmd.Flags().BoolVar(&follow,"follow",false,"followbuild log after initiating rebuild")
6971
cmd.Flags().BoolVar(&force,"force",false,"force rebuild without showing a confirmation prompt")
7072
returncmd
7173
}
@@ -134,20 +136,19 @@ func trailBuildLogs(ctx context.Context, client *coder.Client, envID string) err
134136
returnnil
135137
}
136138

137-
funcwatchBuildLogCommand()*cobra.Command {
139+
funcwatchBuildLogCommand(user*string)*cobra.Command {
138140
cmd:=&cobra.Command{
139141
Use:"watch-build [environment_name]",
140-
Example:"coder watch-build front-end-env",
142+
Example:"coderenvswatch-build front-end-env",
141143
Short:"trail the build log of a Coder environment",
142144
Args:cobra.ExactArgs(1),
143-
Hidden:true,// TODO(@cmoog) un-hide
144145
RunE:func(cmd*cobra.Command,args []string)error {
145146
ctx:=cmd.Context()
146147
client,err:=newClient()
147148
iferr!=nil {
148149
returnerr
149150
}
150-
env,err:=findEnv(ctx,client,args[0],coder.Me)
151+
env,err:=findEnv(ctx,client,args[0],*user)
151152
iferr!=nil {
152153
returnerr
153154
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp