Skip to content

Commit 2f2911a

Browse files
committed
update mentions of templates create command
1 parent 7655bc9 commit 2f2911a

File tree

18 files changed

+21
-171
lines changed

18 files changed

+21
-171
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ jobs:
416416
417417
# Create template
418418
cd ./.github/pr-deployments/template
419-
coder templates create -y --variable namespace=pr${{ env.PR_NUMBER }} kubernetes
419+
coder templates push -y --variable namespace=pr${{ env.PR_NUMBER }} kubernetes
420420
421421
# Create workspace
422422
coder create --template="kubernetes" kube --parameter cpu=2 --parameter memory=4 --parameter home_disk_size=2 -y

cli/templateinit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (*RootCmd) templateInit() *clibase.Cmd {
113113
inv.Stdout,
114114
pretty.Sprint(
115115
cliui.DefaultStyles.Code,
116-
"cd "+relPath+" && coder templates create"),
116+
"cd "+relPath+" && coder templates push"),
117117
)
118118
_, _ = fmt.Fprintln(inv.Stdout, pretty.Sprint(cliui.DefaultStyles.Wrap, "\nExamples provide a starting point and are expected to be edited! 🎨"))
119119
return nil

cli/templatelist.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (r *RootCmd) templateList() *clibase.Cmd {
3636

3737
if len(templates) == 0 {
3838
_, _ = fmt.Fprintf(inv.Stderr, "%s No templates found in %s! Create one:\n\n", Caret, color.HiWhiteString(organization.Name))
39-
_, _ = fmt.Fprintln(inv.Stderr, color.HiMagentaString(" $ coder templates create <directory>\n"))
39+
_, _ = fmt.Fprintln(inv.Stderr, color.HiMagentaString(" $ coder templates push <directory>\n"))
4040
return nil
4141
}
4242

cli/templates.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ func (r *RootCmd) templates() *clibase.Cmd {
1717
Use: "templates",
1818
Short: "Manage templates",
1919
Long: "Templates are written in standard Terraform and describe the infrastructure for workspaces\n" + formatExamples(
20-
example{
21-
Description: "Create a template for developers to create workspaces",
22-
Command: "coder templates create",
23-
},
2420
example{
2521
Description: "Make changes to your template, and plan the changes",
2622
Command: "coder templates plan my-template",
2723
},
2824
example{
29-
Description: "Push an update to the template. Your developers can update their workspaces",
25+
Description: "Create or push an update to the template. Your developers can update their workspaces",
3026
Command: "coder templates push my-template",
3127
},
3228
),

docs/admin/provisioners.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ the [Helm example](#example-running-an-external-provisioner-with-helm) below.
6464

6565
# In another terminal, create/push
6666
# a template that requires this provisioner
67-
coder templates create on-prem \
67+
coder templates push on-prem \
6868
--provisioner-tag environment=on_prem
6969

7070
# Or, match the provisioner exactly
71-
coder templates create on-prem-chicago \
71+
coder templates push on-prem-chicago \
7272
--provisioner-tag environment=on_prem \
7373
--provisioner-tag data_center=chicago
7474
```
@@ -88,7 +88,7 @@ the [Helm example](#example-running-an-external-provisioner-with-helm) below.
8888

8989
# In another terminal, create/push
9090
# a template that requires user provisioners
91-
coder templates create on-prem \
91+
coder templates push on-prem \
9292
--provisioner-tag scope=user
9393
```
9494

docs/cli/templates.md

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/install/openshift.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ Edit `main.tf` and update the following fields of the Kubernetes pod resource:
322322
Finally, create the template:
323323

324324
```console
325-
coder template create kubernetes -d .
325+
coder template push kubernetes -d .
326326
```
327327

328328
This template should be ready to use straight away.

docs/platforms/azure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Navigate to the `./azure-linux` folder where you created your template and run
128128
the following command to put the template on your Coder instance.
129129

130130
```shell
131-
coder templates create
131+
coder templates push
132132
```
133133

134134
Congrats! You can now navigate to your Coder dashboard and use this Linux on

docs/platforms/docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Coder with Docker has the following advantages:
5252
cd docker
5353
```
5454

55-
1. Push up the template with `coder templates create`
55+
1. Push up the template with `coder templates push`
5656

5757
1. Open the dashboard in your browser to create your first workspace:
5858

docs/platforms/kubernetes/additional-clusters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export CLUSTER_SERVICEACCOUNT_TOKEN=$(kubectl get secrets coder-v2 -n coder-work
211211
Create the template with these values:
212212

213213
```shell
214-
coder templates create \
214+
coder templates push \
215215
--variable host=$CLUSTER_ADDRESS \
216216
--variable cluster_ca_certificate=$CLUSTER_CA_CERTIFICATE \
217217
--variable token=$CLUSTER_SERVICEACCOUNT_TOKEN \
@@ -228,7 +228,7 @@ kubectl cluster-info
228228
# Get cluster CA and token (base64 encoded)
229229
kubectl get secrets coder-service-account-token -n coder-workspaces -o jsonpath="{.data}"
230230
231-
coder templates create \
231+
coder templates push \
232232
--variable host=API_ADDRESS \
233233
--variable cluster_ca_certificate=CLUSTER_CA_CERTIFICATE \
234234
--variable token=CLUSTER_SERVICEACCOUNT_TOKEN \

enterprise/cli/templatecreate_test.go

Lines changed: 0 additions & 143 deletions
This file was deleted.

examples/examples.gen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@
155155
"nomad",
156156
"container"
157157
],
158-
"markdown": "\n# Remote Development on Nomad\n\nProvision Nomad Jobs as [Coder workspaces](https://coder.com/docs/coder-v2/latest) with this example template. This example shows how to use Nomad service tasks to be used as a development environment using docker and host csi volumes.\n\n\u003c!-- TODO: Add screenshot --\u003e\n\n\u003e **Note**\n\u003e This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.\n\n## Prerequisites\n\n- [Nomad](https://www.nomadproject.io/downloads)\n- [Docker](https://docs.docker.com/get-docker/)\n\n## Setup\n\n### 1. Start the CSI Host Volume Plugin\n\nThe CSI Host Volume plugin is used to mount host volumes into Nomad tasks. This is useful for development environments where you want to mount persistent volumes into your container workspace.\n\n1. Login to the Nomad server using SSH.\n\n2. Append the following stanza to your Nomad server configuration file and restart the nomad service.\n\n ```hcl\n plugin \"docker\" {\n config {\n allow_privileged = true\n }\n }\n ```\n\n ```shell\n sudo systemctl restart nomad\n ```\n\n3. Create a file `hostpath.nomad` with following content:\n\n ```hcl\n job \"hostpath-csi-plugin\" {\n datacenters = [\"dc1\"]\n type = \"system\"\n\n group \"csi\" {\n task \"plugin\" {\n driver = \"docker\"\n\n config {\n image = \"registry.k8s.io/sig-storage/hostpathplugin:v1.10.0\"\n\n args = [\n \"--drivername=csi-hostpath\",\n \"--v=5\",\n \"--endpoint=${CSI_ENDPOINT}\",\n \"--nodeid=node-${NOMAD_ALLOC_INDEX}\",\n ]\n\n privileged = true\n }\n\n csi_plugin {\n id = \"hostpath\"\n type = \"monolith\"\n mount_dir = \"/csi\"\n }\n\n resources {\n cpu = 256\n memory = 128\n }\n }\n }\n }\n ```\n\n4. Run the job:\n\n ```shell\n nomad job run hostpath.nomad\n ```\n\n### 2. Setup the Nomad Template\n\n1. Create the template by running the following command:\n\n ```shell\n coder template init nomad-docker\n cd nomad-docker\n coder template create\n ```\n\n2. Set up Nomad server address and optional authentication:\n\n3. Create a new workspace and start developing.\n"
158+
"markdown": "\n# Remote Development on Nomad\n\nProvision Nomad Jobs as [Coder workspaces](https://coder.com/docs/coder-v2/latest) with this example template. This example shows how to use Nomad service tasks to be used as a development environment using docker and host csi volumes.\n\n\u003c!-- TODO: Add screenshot --\u003e\n\n\u003e **Note**\n\u003e This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.\n\n## Prerequisites\n\n- [Nomad](https://www.nomadproject.io/downloads)\n- [Docker](https://docs.docker.com/get-docker/)\n\n## Setup\n\n### 1. Start the CSI Host Volume Plugin\n\nThe CSI Host Volume plugin is used to mount host volumes into Nomad tasks. This is useful for development environments where you want to mount persistent volumes into your container workspace.\n\n1. Login to the Nomad server using SSH.\n\n2. Append the following stanza to your Nomad server configuration file and restart the nomad service.\n\n ```hcl\n plugin \"docker\" {\n config {\n allow_privileged = true\n }\n }\n ```\n\n ```shell\n sudo systemctl restart nomad\n ```\n\n3. Create a file `hostpath.nomad` with following content:\n\n ```hcl\n job \"hostpath-csi-plugin\" {\n datacenters = [\"dc1\"]\n type = \"system\"\n\n group \"csi\" {\n task \"plugin\" {\n driver = \"docker\"\n\n config {\n image = \"registry.k8s.io/sig-storage/hostpathplugin:v1.10.0\"\n\n args = [\n \"--drivername=csi-hostpath\",\n \"--v=5\",\n \"--endpoint=${CSI_ENDPOINT}\",\n \"--nodeid=node-${NOMAD_ALLOC_INDEX}\",\n ]\n\n privileged = true\n }\n\n csi_plugin {\n id = \"hostpath\"\n type = \"monolith\"\n mount_dir = \"/csi\"\n }\n\n resources {\n cpu = 256\n memory = 128\n }\n }\n }\n }\n ```\n\n4. Run the job:\n\n ```shell\n nomad job run hostpath.nomad\n ```\n\n### 2. Setup the Nomad Template\n\n1. Create the template by running the following command:\n\n ```shell\n coder template init nomad-docker\n cd nomad-docker\n coder template push\n ```\n\n2. Set up Nomad server address and optional authentication:\n\n3. Create a new workspace and start developing.\n"
159159
}
160160
]

examples/lima/coder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ provision:
103103
fi
104104
DOCKER_HOST=$(docker context inspect --format '{{.Endpoints.docker.Host}}')
105105
printf 'docker_arch: "%s"\ndocker_host: "%s"\n' "${DOCKER_ARCH}" "${DOCKER_HOST}" | tee "${temp_template_dir}/params.yaml"
106-
coder templates create "docker-${DOCKER_ARCH}" --directory "${temp_template_dir}" --variables-file "${temp_template_dir}/params.yaml" --yes
106+
coder templates push "docker-${DOCKER_ARCH}" --directory "${temp_template_dir}" --variables-file "${temp_template_dir}/params.yaml" --yes
107107
rm -rfv "${temp_template_dir}"
108108
probes:
109109
- description: "docker to be installed"

examples/templates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Clone this repository to create a template from any example listed here:
1111
```console
1212
git clone https://github.com/coder/coder
1313
cd examples/templates/aws-linux
14-
coder templates create
14+
coder templates push
1515
```
1616

1717
## Community Templates

examples/templates/envbox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To supply values to existing existing Terraform variables you can specify the
4747
`-V` flag. For example
4848

4949
```bash
50-
coder templates create envbox --var namespace="mynamespace" --var max_cpus=2 --var min_cpus=1 --var max_memory=4 --var min_memory=1
50+
coder templates push envbox --var namespace="mynamespace" --var max_cpus=2 --var min_cpus=1 --var max_memory=4 --var min_memory=1
5151
```
5252

5353
## Contributions

examples/templates/nomad-docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The CSI Host Volume plugin is used to mount host volumes into Nomad tasks. This
9595
```shell
9696
coder template init nomad-docker
9797
cd nomad-docker
98-
coder template create
98+
coder template push
9999
```
100100

101101
2. Set up Nomad server address and optional authentication:

scaletest/lib/coder_init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ CODER_FIRST_USER_TRIAL="${CODER_FIRST_USER_TRIAL}"
6868
EOF
6969

7070
echo "Importing kubernetes template"
71-
DRY_RUN="$DRY_RUN" "$PROJECT_ROOT/scaletest/lib/coder_shim.sh" templates create \
71+
DRY_RUN="$DRY_RUN" "$PROJECT_ROOT/scaletest/lib/coder_shim.sh" templates push \
7272
--global-config="${CONFIG_DIR}" \
7373
--directory "${CONFIG_DIR}/templates/kubernetes" \
7474
--yes kubernetes

scripts/develop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ fatal() {
177177
DOCKER_HOST="$(docker context inspect --format '{{ .Endpoints.docker.Host }}')"
178178
printf 'docker_arch: "%s"\ndocker_host: "%s"\n' "${GOARCH}" "${DOCKER_HOST}" >"${temp_template_dir}/params.yaml"
179179
(
180-
"${CODER_DEV_SHIM}" templates create "${template_name}" --directory "${temp_template_dir}" --variables-file "${temp_template_dir}/params.yaml" --yes
180+
"${CODER_DEV_SHIM}" templates push "${template_name}" --directory "${temp_template_dir}" --variables-file "${temp_template_dir}/params.yaml" --yes
181181
rm -rfv "${temp_template_dir}" # Only delete template dir if template creation succeeds
182182
) || echo "Failed to create a template. The template files are in ${temp_template_dir}"
183183
fi

0 commit comments

Comments
 (0)