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

feat: Add update command to coder-cli #417

Merged
merged 26 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d256581
feat: Add update command to coder-cli
johnstcn Aug 10, 2021
972847e
internal/cmd/update_test.go: refactor unit tests
johnstcn Aug 13, 2021
597afe1
fixup! internal/cmd/update_test.go: refactor unit tests
johnstcn Aug 13, 2021
1373e79
internal/cmd/update_test.go: more tests
johnstcn Aug 13, 2021
513282a
internal/cmd/update_test.go: create dirs in memfs
johnstcn Aug 13, 2021
5bf7f56
internal/cmd/update_test.go: test for windows
johnstcn Aug 13, 2021
dabd178
fixup! internal/cmd/update_test.go: test for windows
johnstcn Aug 13, 2021
dcfeec1
internal/cmd/update.go: replace semver library
johnstcn Aug 13, 2021
0801cfc
internal/cmd/update.go: use /api/private/version instead of sniffing …
johnstcn Aug 13, 2021
f6ce76f
gendocs
johnstcn Aug 13, 2021
6371084
internal/cmd/update.go: use os.Executable() instead of os.Args[0]
johnstcn Aug 13, 2021
bdb998e
internal/cmd/update.go: check path prefixes
johnstcn Aug 13, 2021
306686c
lint
johnstcn Aug 13, 2021
60a75a1
internal/cmd/update_test.go: assertCLIError helper function for clog.…
johnstcn Aug 16, 2021
26984a2
internal/cmd/update.go: allow explicitly specifying version
johnstcn Aug 16, 2021
bcaac7b
internal/cmd/update.go: validate we can exec new binary
johnstcn Aug 16, 2021
2002876
fixup! internal/cmd/update.go: validate we can exec new binary
johnstcn Aug 16, 2021
3ba1bed
internal/cmd/update.go: query github releases api for assets
johnstcn Aug 16, 2021
6238053
internal/cmd/update.go: handle copy error from archive
johnstcn Aug 17, 2021
24df4f7
internal/cmd/update.go: handle windows-specific behaviours
johnstcn Aug 17, 2021
21dd836
fixup! internal/cmd/update.go: handle windows-specific behaviours
johnstcn Aug 17, 2021
e064c47
fixup! internal/cmd/update.go: handle windows-specific behaviours
johnstcn Aug 17, 2021
eefa2f3
gofmt
johnstcn Aug 17, 2021
0e63d2f
internal/cmd/users_test.go: assert CICD user instead of admin
johnstcn Aug 17, 2021
60944f0
Revert "internal/cmd/users_test.go: assert CICD user instead of admin"
johnstcn Aug 17, 2021
c8943ed
Merge branch 'master' into cianjohnston/autoupdate
johnstcn Aug 17, 2021
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
1 change: 1 addition & 0 deletions docs/coder.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ coder provides a CLI for working with an existing Coder installation
* [coder ssh](coder_ssh.md) - Enter a shell of execute a command over SSH into a Coder workspace
* [coder sync](coder_sync.md) - Establish a one way directory sync to a Coder workspace
* [coder tokens](coder_tokens.md) - manage Coder API tokens for the active user
* [coder update](coder_update.md) - Update coder binary
* [coder urls](coder_urls.md) - Interact with workspace DevURLs
* [coder users](coder_users.md) - Interact with Coder user accounts
* [coder workspaces](coder_workspaces.md) - Interact with Coder workspaces
Expand Down
31 changes: 31 additions & 0 deletions docs/coder_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## coder update

Update coder binary

### Synopsis

Update coder to the version matching a given coder instance.

```
coder update [flags]
```

### Options

```
--coder string query this coder instance for the matching version
--force do not prompt for confirmation
-h, --help help for update
--version string explicitly specify which version to fetch and install
```

### Options inherited from parent commands

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

### SEE ALSO

* [coder](coder.md) - coder provides a CLI for working with an existing Coder installation

2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.14
require (
cdr.dev/slog v1.4.1
cdr.dev/wsep v0.0.0-20200728013649-82316a09813f
github.com/Masterminds/semver/v3 v3.1.1
github.com/briandowns/spinner v1.16.0
github.com/cli/safeexec v1.0.0
github.com/fatih/color v1.12.0
Expand All @@ -23,6 +24,7 @@ require (
github.com/pion/webrtc/v3 v3.0.32
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
github.com/rjeczalik/notify v0.9.2
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0=
github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
Expand Down Expand Up @@ -378,6 +380,7 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5I
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw=
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func Make() *cobra.Command {
tagsCmd(),
tokensCmd(),
tunnelCmd(),
updateCmd(),
urlCmd(),
usersCmd(),
workspacesCmd(),
Expand Down
Loading