Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e63487

Browse files
authored
Rename template update to template push (#3307)
Before, there was a `template edit` AND a `template update`. The distinction between both commands was easy to forget. `push` more clearly indicates that the template's source code is being updated. It is also complimentary to existing `template pull`.
1 parent 4b9daf5 commit 6e63487

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

cli/templateupdate.go renamed to cli/templatepush.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/coder/coder/provisionersdk"
1717
)
1818

19-
func templateUpdate() *cobra.Command {
19+
func templatePush() *cobra.Command {
2020
var (
2121
directory string
2222
provisioner string
@@ -25,9 +25,9 @@ func templateUpdate() *cobra.Command {
2525
)
2626

2727
cmd := &cobra.Command{
28-
Use: "update [template]",
28+
Use: "push [template]",
2929
Args: cobra.MaximumNArgs(1),
30-
Short: "Update the source-code of a template from the current directory or as specified by flag",
30+
Short: "Push a new template version from the current directory or as specified by flag",
3131
RunE: func(cmd *cobra.Command, args []string) error {
3232
client, err := createClient(cmd)
3333
if err != nil {

cli/templateupdate_test.go renamed to cli/templatepush_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/coder/coder/pty/ptytest"
1818
)
1919

20-
func TestTemplateUpdate(t *testing.T) {
20+
func TestTemplatePush(t *testing.T) {
2121
t.Parallel()
2222
// NewParameter will:
2323
// 1. Create a template version with 0 params
@@ -43,7 +43,7 @@ func TestTemplateUpdate(t *testing.T) {
4343
Parse: createTestParseResponse(),
4444
Provision: echo.ProvisionComplete,
4545
})
46-
cmd, root := clitest.New(t, "templates", "update", template.Name, "-y", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
46+
cmd, root := clitest.New(t, "templates", "push", template.Name, "-y", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
4747
clitest.SetupConfig(t, client, root)
4848
pty := ptytest.New(t)
4949
cmd.SetIn(pty.Input())
@@ -76,7 +76,7 @@ func TestTemplateUpdate(t *testing.T) {
7676

7777
// Second update of the same source requires no prompt since the params
7878
// are carried over.
79-
cmd, root = clitest.New(t, "templates", "update", template.Name, "-y", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
79+
cmd, root = clitest.New(t, "templates", "push", template.Name, "-y", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
8080
clitest.SetupConfig(t, client, root)
8181
go func() {
8282
execDone <- cmd.Execute()
@@ -95,7 +95,7 @@ func TestTemplateUpdate(t *testing.T) {
9595
Provision: echo.ProvisionComplete,
9696
})
9797

98-
cmd, root = clitest.New(t, "templates", "update", template.Name, "-y", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
98+
cmd, root = clitest.New(t, "templates", "push", template.Name, "-y", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
9999
clitest.SetupConfig(t, client, root)
100100
go func() {
101101
execDone <- cmd.Execute()
@@ -122,7 +122,7 @@ func TestTemplateUpdate(t *testing.T) {
122122
Parse: echo.ParseComplete,
123123
Provision: echo.ProvisionComplete,
124124
})
125-
cmd, root := clitest.New(t, "templates", "update", template.Name, "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
125+
cmd, root := clitest.New(t, "templates", "push", template.Name, "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
126126
clitest.SetupConfig(t, client, root)
127127
pty := ptytest.New(t)
128128
cmd.SetIn(pty.Input())
@@ -175,7 +175,7 @@ func TestTemplateUpdate(t *testing.T) {
175175

176176
// Don't pass the name of the template, it should use the
177177
// directory of the source.
178-
cmd, root := clitest.New(t, "templates", "update", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
178+
cmd, root := clitest.New(t, "templates", "push", "--directory", source, "--test.provisioner", string(database.ProvisionerTypeEcho))
179179
clitest.SetupConfig(t, client, root)
180180
pty := ptytest.New(t)
181181
cmd.SetIn(pty.Input())

cli/templates.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ func templates() *cobra.Command {
2626
Command: "coder templates plan my-template",
2727
},
2828
example{
29-
Description: "Update the template. Your developers can update their workspaces",
30-
Command: "coder templates update my-template",
29+
Description: "Push an update to the template. Your developers can update their workspaces",
30+
Command: "coder templates push my-template",
3131
},
3232
),
3333
}
@@ -37,7 +37,7 @@ func templates() *cobra.Command {
3737
templateInit(),
3838
templateList(),
3939
templatePlan(),
40-
templateUpdate(),
40+
templatePush(),
4141
templateVersions(),
4242
templateDelete(),
4343
templatePull(),

0 commit comments

Comments
 (0)