Skip to content

Commit 968d626

Browse files
committed
add: code-server to gcp templates
1 parent 17006c2 commit 968d626

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

examples/templates/gcp-linux/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@ resource "coder_agent" "main" {
4949
auth = "google-instance-identity"
5050
arch = "amd64"
5151
os = "linux"
52+
startup_script = <<EOT
53+
#!/bin/bash
54+
55+
# install and start code-server
56+
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
57+
code-server --auth none --port 13337 | tee code-server-install.log &
58+
EOT
59+
}
60+
61+
# code-server
62+
resource "coder_app" "code-server" {
63+
agent_id = coder_agent.main.id
64+
name = "code-server"
65+
icon = "/icon/code.svg"
66+
url = "http://localhost:13337?folder=/home/coder"
67+
relative_path = true
5268
}
5369

5470
resource "google_compute_instance" "dev" {

examples/templates/gcp-vm-container/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ resource "coder_agent" "main" {
3939
auth = "google-instance-identity"
4040
arch = "amd64"
4141
os = "linux"
42+
startup_script = <<EOT
43+
#!/bin/bash
44+
45+
# install and start code-server
46+
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
47+
code-server --auth none --port 13337 | tee code-server-install.log &
48+
EOT
49+
}
50+
51+
# code-server
52+
resource "coder_app" "code-server" {
53+
agent_id = coder_agent.main.id
54+
name = "code-server"
55+
icon = "/icon/code.svg"
56+
url = "http://localhost:13337?folder=/home/coder"
57+
relative_path = true
4258
}
4359

4460
module "gce-container" {

0 commit comments

Comments
 (0)