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

Unhide rebuild and watch-build commands#161

Merged
cmoog merged 5 commits intomasterfromunhide-commands
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletionsdocs/coder_envs.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,5 +23,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 ls](coder_envs_ls.md) - list all environments owned by the active user
* [coder envs rebuild](coder_envs_rebuild.md) - rebuild a Coder environment
* [coder envs stop](coder_envs_stop.md) - stop Coder environments by name
* [coder envs watch-build](coder_envs_watch-build.md) - trail the build log of a Coder environment

34 changes: 34 additions & 0 deletionsdocs/coder_envs_rebuild.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
## coder envs rebuild

rebuild a Coder environment

```
coder envs rebuild [environment_name] [flags]
```

### Examples

```
coder envs rebuild front-end-env --follow
coder envs rebuild backend-env --force
```

### Options

```
--follow follow build log after initiating rebuild
--force force rebuild without showing a confirmation prompt
-h, --help help for rebuild
```

### Options inherited from parent commands

```
--user string Specify the user whose resources to target (default "me")
-v, --verbose show verbose output
```

### SEE ALSO

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

31 changes: 31 additions & 0 deletionsdocs/coder_envs_watch-build.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
## coder envs watch-build

trail the build log of a Coder environment

```
coder envs watch-build [environment_name] [flags]
```

### Examples

```
coder envs watch-build front-end-env
```

### Options

```
-h, --help help for watch-build
```

### Options inherited from parent commands

```
--user string Specify the user whose resources to target (default "me")
-v, --verbose show verbose output
```

### SEE ALSO

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

4 changes: 2 additions & 2 deletionsinternal/cmd/envs.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,8 +30,8 @@ func envsCommand() *cobra.Command {
lsEnvsCommand(&user),
stopEnvsCommand(&user),
rmEnvsCommand(&user),
watchBuildLogCommand(),
rebuildEnvCommand(),
watchBuildLogCommand(&user),
rebuildEnvCommand(&user),
createEnvCommand(&user),
editEnvCommand(&user),
)
Expand Down
19 changes: 10 additions & 9 deletionsinternal/cmd/rebuild.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,7 @@ import (
"golang.org/x/xerrors"
)

func rebuildEnvCommand() *cobra.Command {
func rebuildEnvCommand(user *string) *cobra.Command {
var follow bool
var force bool
cmd := &cobra.Command{
Expand All@@ -26,14 +26,13 @@ func rebuildEnvCommand() *cobra.Command {
Args: cobra.ExactArgs(1),
Example: `coder envs rebuild front-end-env --follow
coder envs rebuild backend-env --force`,
Hidden: true, // TODO(@cmoog) un-hide
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
client, err := newClient()
if err != nil {
return err
}
env, err := findEnv(ctx, client, args[0],coder.Me)
env, err := findEnv(ctx, client, args[0],*user)
if err != nil {
return err
}
Expand All@@ -44,7 +43,10 @@ coder envs rebuild backend-env --force`,
IsConfirm: true,
}).Run()
if err != nil {
return err
return clog.Fatal(
"failed to confirm prompt", clog.BlankLine,
clog.Tipf(`use "--force" to rebuild without a confirmation prompt`),
)
}
}

Expand All@@ -65,7 +67,7 @@ coder envs rebuild backend-env --force`,
},
}

cmd.Flags().BoolVar(&follow, "follow", false, "followbuildlog after initiating rebuild")
cmd.Flags().BoolVar(&follow, "follow", false, "followbuild log after initiating rebuild")
cmd.Flags().BoolVar(&force, "force", false, "force rebuild without showing a confirmation prompt")
return cmd
}
Expand DownExpand Up@@ -134,20 +136,19 @@ func trailBuildLogs(ctx context.Context, client *coder.Client, envID string) err
return nil
}

func watchBuildLogCommand() *cobra.Command {
func watchBuildLogCommand(user *string) *cobra.Command {
cmd := &cobra.Command{
Use: "watch-build [environment_name]",
Example: "coder watch-build front-end-env",
Example: "coderenvswatch-build front-end-env",
Short: "trail the build log of a Coder environment",
Args: cobra.ExactArgs(1),
Hidden: true, // TODO(@cmoog) un-hide
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
client, err := newClient()
if err != nil {
return err
}
env, err := findEnv(ctx, client, args[0],coder.Me)
env, err := findEnv(ctx, client, args[0],*user)
if err != nil {
return err
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp