Skip to content

Commit e8eb3e4

Browse files
committed
fixup!
1 parent 579778e commit e8eb3e4

File tree

10 files changed

+217
-147
lines changed

10 files changed

+217
-147
lines changed

docs/admin/templates/extending-templates/ides/vscode-desktop.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@ module "vscode" {
2626
> [multi-root](https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspaces)
2727
> workspaces.
2828
29-
## Manual Installation
30-
31-
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press
32-
enter.
33-
34-
```text
35-
ext install coder.coder-remote
36-
```
37-
38-
Alternatively, manually install the VSIX from the
39-
[latest release](https://github.com/coder/vscode-coder/releases/latest).
40-
4129
## VS Code extensions
4230

4331
There are multiple ways to add extensions to VS Code Desktop:

docs/admin/templates/extending-templates/ides/web-ides.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
# Web IDEs
22

3-
By default, Coder workspaces allow connections via:
4-
5-
- Web terminal
6-
- SSH (plus any [SSH-compatible IDE](../ides/README.md))
7-
8-
It's common to also let developers to connect via web IDEs for uses cases like
9-
zero trust networks, data science, contractors, and infrequent code
10-
contributors.
11-
12-
![Row of IDEs](../../../../images/ide-row.png)
13-
143
In Coder, web IDEs are defined as
154
[coder_app](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app)
165
resources in the template. With our generic model, any web application can be

docs/admin/templates/managing-templates.md renamed to docs/admin/templates/managing-templates/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ here!
2424

2525
![Starter templates](../../images/templates/starter-templates.png)
2626

27-
If you prefer to use Coder on the [command line](../cli.md), use
27+
If you prefer to use Coder on the [command line](../../reference/cli/README.md),
2828
`coder templates init`.
2929

3030
> Coder starter templates are also available on our
@@ -87,7 +87,10 @@ template:
8787
coder templates delete <template-name>
8888
```
8989

90+
<children></children>
91+
9092
## Next steps
9193

92-
- [Your first template](../templates/tutorial.md)
9394
- [Image management](./image-management.md)
95+
- [Devcontainer templates](./devcontainer-templates.md)
96+
- [Change management](./change-management.md)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Template Change Management
2+
3+
We recommend source-controlling your templates as you would other any code, and
4+
automating the creation of new versions in CI/CD pipelines.
5+
6+
These pipelines will require tokens for your deployment. To cap token lifetime
7+
on creation,
8+
[configure Coder server to set a shorter max token lifetime](../reference/cli/server.md#--max-token-lifetime).
9+
10+
## coderd Terraform Provider
11+
12+
The
13+
[coderd Terraform provider](https://registry.terraform.io/providers/coder/coderd/latest)
14+
can be used to push new template versions, either manually, or in CI/CD
15+
pipelines. To run the provider in a CI/CD pipeline, and to prevent drift, you'll
16+
need to store the Terraform state
17+
[remotely](https://developer.hashicorp.com/terraform/language/settings/backends/configuration).
18+
19+
```hcl
20+
terraform {
21+
required_providers {
22+
coderd = {
23+
source = "coder/coderd"
24+
}
25+
}
26+
backend "gcs" {
27+
bucket = "example-bucket"
28+
prefix = "terraform/state"
29+
}
30+
}
31+
32+
provider "coderd" {
33+
// Can be populated from environment variables
34+
url = "https://coder.example.com"
35+
token = "****"
36+
}
37+
38+
// Get the commit SHA of the configuration's git repository
39+
variable "TFC_CONFIGURATION_VERSION_GIT_COMMIT_SHA" {
40+
type = string
41+
}
42+
43+
resource "coderd_template" "kubernetes" {
44+
name = "kubernetes"
45+
description = "Develop in Kubernetes!"
46+
versions = [{
47+
directory = ".coder/templates/kubernetes"
48+
active = true
49+
# Version name is optional
50+
name = var.TFC_CONFIGURATION_VERSION_GIT_COMMIT_SHA
51+
tf_vars = [{
52+
name = "namespace"
53+
value = "default4"
54+
}]
55+
}]
56+
/* ... Additional template configuration */
57+
}
58+
```
59+
60+
For an example, see how we push our development image and template
61+
[with GitHub actions](https://github.com/coder/coder/blob/main/.github/workflows/dogfood.yaml).
62+
63+
## Coder CLI
64+
65+
You can also [install Coder](../install/) to automate pushing new template
66+
versions in CI/CD pipelines.
67+
68+
```console
69+
# Install the Coder CLI
70+
curl -L https://coder.com/install.sh | sh
71+
# curl -L https://coder.com/install.sh | sh -s -- --version=0.x
72+
73+
# To create API tokens, use `coder tokens create`.
74+
# If no `--lifetime` flag is passed during creation, the default token lifetime
75+
# will be 30 days.
76+
# These variables are consumed by Coder
77+
export CODER_URL=https://coder.example.com
78+
export CODER_SESSION_TOKEN=*****
79+
80+
# Template details
81+
export CODER_TEMPLATE_NAME=kubernetes
82+
export CODER_TEMPLATE_DIR=.coder/templates/kubernetes
83+
export CODER_TEMPLATE_VERSION=$(git rev-parse --short HEAD)
84+
85+
# Push the new template version to Coder
86+
coder templates push --yes $CODER_TEMPLATE_NAME \
87+
--directory $CODER_TEMPLATE_DIR \
88+
--name=$CODER_TEMPLATE_VERSION # Version name is optional
89+
```
90+
91+
## Next Steps
92+
93+
- [Coder CLI Reference](../reference/cli/templates.md)
94+
- [Coderd Terraform Provider Reference](https://registry.terraform.io/providers/coder/coderd/latest/docs)
95+
- [Coderd API Reference](https://coder.com/docs/reference/api/README.md)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Dev Containers (alpha)
2+
3+
[Development containers](https://containers.dev) are an open source
4+
specification for defining development environments.
5+
6+
[envbuilder](https://github.com/coder/envbuilder) is an open source project by
7+
Coder that runs dev containers via Coder templates and your underlying
8+
infrastructure. It can run on Docker or Kubernetes.
9+
10+
There are several benefits to adding a devcontainer-compatible template to
11+
Coder:
12+
13+
- Drop-in migration from Codespaces (or any existing repositories that use dev
14+
containers)
15+
- Easier to start projects from Coder. Just create a new workspace then pick a
16+
starter devcontainer.
17+
- Developer teams can "bring their own image." No need for platform teams to
18+
manage complex images, registries, and CI pipelines.
19+
20+
## How it works
21+
22+
A Coder admin adds a devcontainer-compatible template to Coder (envbuilder).
23+
Then developers enter their repository URL as a [parameter](./parameters.md)
24+
when they create their workspace.
25+
[envbuilder](https://github.com/coder/envbuilder) clones the repo and builds a
26+
container from the `devcontainer.json` specified in the repo.
27+
28+
Developers can edit the `devcontainer.json` in their workspace to rebuild to
29+
iterate on their development environments.
30+
31+
## Example templates
32+
33+
- [Docker](https://github.com/coder/coder/tree/main/examples/templates/devcontainer-docker)
34+
- [Kubernetes](https://github.com/coder/coder/tree/main/examples/templates/devcontainer-kubernetes)
35+
36+
![Devcontainer parameter screen](../images/templates/devcontainers.png)
37+
38+
Your template can prompt the user for a repo URL with
39+
[Parameters](./parameters.md).
40+
41+
## Authentication
42+
43+
You may need to authenticate to your container registry, such as Artifactory, or
44+
git provider such as GitLab, to use envbuilder. See the
45+
[envbuilder documentation](https://github.com/coder/envbuilder/) for more
46+
information.
47+
48+
## Caching
49+
50+
To improve build times, dev containers can be cached. Refer to the
51+
[envbuilder documentation](https://github.com/coder/envbuilder/) for more
52+
information.
53+
54+
## Other features & known issues
55+
56+
Envbuilder is still under active development. Refer to the
57+
[envbuilder GitHub repo](https://github.com/coder/envbuilder/) for more
58+
information and to submit feature requests.

docs/admin/templates/image-management.md renamed to docs/admin/templates/managing-templates/image-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ specific tooling for their projects. The [Dev Container](https://containers.dev)
7070
specification allows developers to define their projects dependencies within a
7171
`devcontainer.json` in their Git repository.
7272

73-
- [Learn how to integrate Dev Containers with Coder](#TODO)
73+
- [Learn how to integrate Dev Containers with Coder](./devcontainers.md)

docs/manifest.json

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"versions": ["main"],
2+
"versions": [
3+
"main"
4+
],
35
"routes": [
46
{
57
"title": "About",
@@ -115,6 +117,11 @@
115117
"title": "Port Forwarding",
116118
"description": "Access ports on your workspace",
117119
"path": "./user-guides/workspace-access/port-forwarding.md"
120+
},
121+
{
122+
"title": "Filebrowser",
123+
"description": "Access your workspace files",
124+
"path": "./user-guides/workspace-access/filebrowser.md"
118125
}
119126
]
120127
},
@@ -228,6 +235,28 @@
228235
"description": "Learn how to create templates with Terraform",
229236
"path": "./admin/templates/creating-templates.md"
230237
},
238+
{
239+
"title": "Managing Templates",
240+
"description": "Learn how to manage templates and best practices",
241+
"path": "./admin/templates/managing-templates/README.md.md",
242+
"children": [
243+
{
244+
"title": "Image Management",
245+
"description": "Learn about template image management",
246+
"path": "./admin/templates/managing-templates/image-management.md"
247+
},
248+
{
249+
"title": "Change Management",
250+
"description": "Learn about template change management and versioning",
251+
"path": "./admin/templates/managing-templates/change-management.md"
252+
},
253+
{
254+
"title": "Devcontainers",
255+
"description": "Learn about using devcontainers in templates",
256+
"path": "./admin/templates/managing-templates/devcontainers.md"
257+
}
258+
]
259+
},
231260
{
232261
"title": "Extending Templates",
233262
"description": "Learn best practices in extending templates",
@@ -262,6 +291,16 @@
262291
"title": "Terraform Variables",
263292
"description": "Use variables to manage template state",
264293
"path": "./admin/templates/extending-templates/variables.md"
294+
},
295+
{
296+
"title": "IDEs",
297+
"description": "Add and configure IDEs in your templates",
298+
"path": "./admin/templates/extending-templates/ides/README.md"
299+
},
300+
{
301+
"title": "Filebrowser",
302+
"description": "Add Filebrowser to your templates",
303+
"path": "./admin/templates/extending-templates/filebrowser.md"
265304
}
266305
]
267306
},
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# File Browser
2+
3+
File Browser is a file manager for the web that can be used to upload, download,
4+
and view files in your workspace. A template administrator can add it by
5+
following the
6+
[Extending Templates](../../admin/templates/extending-templates/filebrowser.md)
7+
guide. ![File Browser](../images/file-browser.png)

docs/user-guides/workspace-access/vscode.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ extension, authenticates with Coder, and connects to the workspace.
1414

1515
![Demo](https://github.com/coder/vscode-coder/raw/main/demo.gif?raw=true)
1616

17-
You can set the default directory in which VS Code opens via the `dir` argument
18-
on the `coder_agent` resource in your workspace template. See the
19-
[Terraform documentation for more details](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#dir).
20-
2117
> The `VS Code Desktop` button can be hidden by enabling
2218
> [Browser-only connections](./networking/index.md#Browser-only).
2319
@@ -34,10 +30,6 @@ ext install coder.coder-remote
3430
Alternatively, manually install the VSIX from the
3531
[latest release](https://github.com/coder/vscode-coder/releases/latest).
3632

37-
## code-server
38-
39-
[code-server](https://github.com/coder/code-server) is our supported method of
40-
running VS Code in the web browser. You can read more in our
41-
[documentation for code-server](https://coder.com/docs/code-server/latest).
42-
43-
![code-server in a workspace](../../images/code-server-ide.png)
33+
> **Note**: To configure the extensions and default directory of VS Code, A
34+
> template administrator can follow the guide on
35+
> [Extending Templates](../../admin/templates/extending-templates/ides/vscode-desktop.md).

0 commit comments

Comments
 (0)