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

Commit59a0a20

Browse files
authored
feat: Add update command to coder-cli (#417)
* feat: Add update command to coder-cliThis commit adds a new update subcommand that queries a Coder instancefor its current version, fetches the corresponding version fromGitHub releases if required, and updates the binary in-place.
1 parent4117dc8 commit59a0a20

File tree

8 files changed

+1074
-1
lines changed

8 files changed

+1074
-1
lines changed

‎docs/coder.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ coder provides a CLI for working with an existing Coder installation
2020
*[coder ssh](coder_ssh.md) - Enter a shell of execute a command over SSH into a Coder workspace
2121
*[coder sync](coder_sync.md) - Establish a one way directory sync to a Coder workspace
2222
*[coder tokens](coder_tokens.md) - manage Coder API tokens for the active user
23+
*[coder update](coder_update.md) - Update coder binary
2324
*[coder urls](coder_urls.md) - Interact with workspace DevURLs
2425
*[coder users](coder_users.md) - Interact with Coder user accounts
2526
*[coder workspaces](coder_workspaces.md) - Interact with Coder workspaces

‎docs/coder_update.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
##coder update
2+
3+
Update coder binary
4+
5+
###Synopsis
6+
7+
Update coder to the version matching a given coder instance.
8+
9+
```
10+
coder update [flags]
11+
```
12+
13+
###Options
14+
15+
```
16+
--coder string query this coder instance for the matching version
17+
--force do not prompt for confirmation
18+
-h, --help help for update
19+
--version string explicitly specify which version to fetch and install
20+
```
21+
22+
###Options inherited from parent commands
23+
24+
```
25+
-v, --verbose show verbose output
26+
```
27+
28+
###SEE ALSO
29+
30+
*[coder](coder.md) - coder provides a CLI for working with an existing Coder installation
31+

‎go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.14
55
require (
66
cdr.dev/slogv1.4.1
77
cdr.dev/wsepv0.0.0-20200728013649-82316a09813f
8+
github.com/Masterminds/semver/v3v3.1.1
89
github.com/briandowns/spinnerv1.16.0
910
github.com/cli/safeexecv1.0.0
1011
github.com/fatih/colorv1.12.0
@@ -23,6 +24,7 @@ require (
2324
github.com/pion/webrtc/v3v3.0.32
2425
github.com/pkg/browserv0.0.0-20180916011732-0a3d74bf9ce4
2526
github.com/rjeczalik/notifyv0.9.2
27+
github.com/spf13/aferov1.6.0
2628
github.com/spf13/cobrav1.2.1
2729
github.com/stretchr/testifyv1.7.0
2830
golang.org/x/cryptov0.0.0-20210711020723-a769d52b0f97

‎go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
4949
github.com/BurntSushi/xgbv0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
5050
github.com/GeertJohan/go.incrementalv1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0=
5151
github.com/GeertJohan/go.ricev1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0=
52+
github.com/Masterminds/semver/v3v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
53+
github.com/Masterminds/semver/v3v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
5254
github.com/akavel/rsrcv0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
5355
github.com/alecthomas/assertv0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
5456
github.com/alecthomas/assertv0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
@@ -378,6 +380,7 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5I
378380
github.com/shurcooL/sanitized_anchor_namev1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
379381
github.com/smartystreets/assertionsv0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
380382
github.com/smartystreets/goconveyv1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
383+
github.com/spf13/aferov1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
381384
github.com/spf13/aferov1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
382385
github.com/spf13/castv1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
383386
github.com/spf13/cobrav1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw=

‎internal/cmd/cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func Make() *cobra.Command {
3838
tagsCmd(),
3939
tokensCmd(),
4040
tunnelCmd(),
41+
updateCmd(),
4142
urlCmd(),
4243
usersCmd(),
4344
workspacesCmd(),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp