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

Commitccecc2f

Browse files
authored
fix: rename envs to workspaces (#421)
* Fix a few stray uses of the legacy "environments" terminology and replace it with "workspaces"* Rename Workspaces as Code to Workspace Templates
1 parenta430ef6 commitccecc2f

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

‎coder-sdk/workspace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ type ParseTemplateRequest struct {
112112
Local io.Reader`json:"-"`
113113
}
114114

115-
// TemplateVersion is aWorkspaces As Code (WAC) template.
115+
// TemplateVersion is aworkspace template.
116116
// For now, let's not interpret it on the CLI level. We just need
117117
// to forward this as part of the create workspace request.
118118
typeTemplateVersionstruct {

‎docs/coder_workspaces_create-from-config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ create a new workspace from a template
44

55
###Synopsis
66

7-
Create a new Coder workspace using aWorkspaces As Code template.
7+
Create a new Coder workspace using aworkspace template.
88

99
```
1010
coder workspaces create-from-config [flags]
@@ -14,8 +14,8 @@ coder workspaces create-from-config [flags]
1414

1515
```
1616
# create a new workspace from git repository
17-
coderenvs create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch
18-
coderenvs create-from-config --name="dev-env" -f coder.yaml
17+
coderworkspaces create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch
18+
coderworkspaces create-from-config --name="dev-env" --filepath coder.yaml
1919
```
2020

2121
###Options

‎docs/coder_workspaces_edit-from-config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ change the template a workspace is tracking
44

55
###Synopsis
66

7-
Edit an existing Coder workspace using aWorkspaces As Code template.
7+
Edit an existing Coder workspace using aworkspace template.
88

99
```
1010
coder workspaces edit-from-config [flags]
@@ -14,8 +14,8 @@ coder workspaces edit-from-config [flags]
1414

1515
```
1616
# edit a new workspace from git repository
17-
coderenvs edit-from-config dev-env --repo-url https://github.com/cdr/m --ref my-branch
18-
coderenvs edit-from-config dev-env -f coder.yaml
17+
coderworkspaces edit-from-config dev-env --repo-url https://github.com/cdr/m --ref my-branch
18+
coderworkspaces edit-from-config dev-env --filepath coder.yaml
1919
```
2020

2121
###Options

‎internal/cmd/workspaces.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -542,22 +542,22 @@ func selectOrg(needle string, haystack []coder.Organization) (*coder.Organizatio
542542
// If `update` is true, the update command is returned. If false, the create command.
543543
funcworkspaceFromConfigCmd(updatebool)*cobra.Command {
544544
var (
545-
refstring
546-
repostring
547-
followbool
548-
filepathstring
549-
orgstring
550-
providerNamestring
551-
envNamestring
545+
refstring
546+
repostring
547+
followbool
548+
filepathstring
549+
orgstring
550+
providerNamestring
551+
workspaceNamestring
552552
)
553553

554554
run:=func(cmd*cobra.Command,args []string)error {
555555
ctx:=cmd.Context()
556556

557557
// Update requires the env name, and the name should be the first argument.
558558
ifupdate {
559-
envName=args[0]
560-
}elseifenvName=="" {
559+
workspaceName=args[0]
560+
}elseifworkspaceName=="" {
561561
// Create takes the name as a flag, and it must be set
562562
returnclog.Error("Must provide a workspace name.",
563563
clog.BlankLine,
@@ -581,17 +581,17 @@ func workspaceFromConfigCmd(update bool) *cobra.Command {
581581
}
582582

583583
// This is the env to be updated/created
584-
varenv*coder.Workspace
584+
varworkspace*coder.Workspace
585585

586586
// OrgID is the org where the template and env should be created.
587587
// If we are updating an env, use the orgID from the workspace.
588588
varorgIDstring
589589
ifupdate {
590-
env,err=findWorkspace(ctx,client,envName,coder.Me)
590+
workspace,err=findWorkspace(ctx,client,workspaceName,coder.Me)
591591
iferr!=nil {
592592
returnhandleAPIError(err)
593593
}
594-
orgID=env.OrganizationID
594+
orgID=workspace.OrganizationID
595595
}else {
596596
varuserOrg*coder.Organization
597597
// Select org in list or use default
@@ -637,16 +637,16 @@ func workspaceFromConfigCmd(update bool) *cobra.Command {
637637
}
638638

639639
ifupdate {
640-
err=client.EditWorkspace(ctx,env.ID, coder.UpdateWorkspaceReq{
640+
err=client.EditWorkspace(ctx,workspace.ID, coder.UpdateWorkspaceReq{
641641
TemplateID:&version.TemplateID,
642642
})
643643
}else {
644-
env,err=client.CreateWorkspace(ctx, coder.CreateWorkspaceRequest{
644+
workspace,err=client.CreateWorkspace(ctx, coder.CreateWorkspaceRequest{
645645
OrgID:orgID,
646646
TemplateID:version.TemplateID,
647647
ResourcePoolID:provider.ID,
648648
Namespace:provider.DefaultNamespace,
649-
Name:envName,
649+
Name:workspaceName,
650650
})
651651
}
652652
iferr!=nil {
@@ -655,15 +655,15 @@ func workspaceFromConfigCmd(update bool) *cobra.Command {
655655

656656
iffollow {
657657
clog.LogSuccess("creating workspace...")
658-
iferr:=trailBuildLogs(ctx,client,env.ID);err!=nil {
658+
iferr:=trailBuildLogs(ctx,client,workspace.ID);err!=nil {
659659
returnerr
660660
}
661661
returnnil
662662
}
663663

664664
clog.LogSuccess("creating workspace...",
665665
clog.BlankLine,
666-
clog.Tipf(`run "coderenvs watch-build %s" totrail thebuild logs`,env.Name),
666+
clog.Tipf(`run "coderworkspaces watch-build %s" toseebuild logs`,workspace.Name),
667667
)
668668
returnnil
669669
}
@@ -673,25 +673,25 @@ func workspaceFromConfigCmd(update bool) *cobra.Command {
673673
cmd=&cobra.Command{
674674
Use:"edit-from-config",
675675
Short:"change the template a workspace is tracking",
676-
Long:"Edit an existing Coder workspace using aWorkspaces As Code template.",
676+
Long:"Edit an existing Coder workspace using aworkspace template.",
677677
Args:cobra.ExactArgs(1),
678678
Example:`# edit a new workspace from git repository
679-
coderenvs edit-from-config dev-env --repo-url https://github.com/cdr/m --ref my-branch
680-
coderenvs edit-from-config dev-env -f coder.yaml`,
679+
coderworkspaces edit-from-config dev-env --repo-url https://github.com/cdr/m --ref my-branch
680+
coderworkspaces edit-from-config dev-env --filepath coder.yaml`,
681681
RunE:run,
682682
}
683683
}else {
684684
cmd=&cobra.Command{
685685
Use:"create-from-config",
686686
Short:"create a new workspace from a template",
687-
Long:"Create a new Coder workspace using aWorkspaces As Code template.",
687+
Long:"Create a new Coder workspace using aworkspace template.",
688688
Example:`# create a new workspace from git repository
689-
coderenvs create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch
690-
coderenvs create-from-config --name="dev-env" -f coder.yaml`,
689+
coderworkspaces create-from-config --name="dev-env" --repo-url https://github.com/cdr/m --ref my-branch
690+
coderworkspaces create-from-config --name="dev-env" --filepath coder.yaml`,
691691
RunE:run,
692692
}
693693
cmd.Flags().StringVar(&providerName,"provider","","name of Workspace Provider with which to create the workspace")
694-
cmd.Flags().StringVar(&envName,"name","","name of the workspace to be created")
694+
cmd.Flags().StringVar(&workspaceName,"name","","name of the workspace to be created")
695695
cmd.Flags().StringVarP(&org,"org","o","","name of the organization the workspace should be created under.")
696696
// Ref and repo-url can only be used for create
697697
cmd.Flags().StringVarP(&ref,"ref","","master","git reference to pull template from. May be a branch, tag, or commit hash.")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp