File tree 16 files changed +126
-78
lines changed
16 files changed +126
-78
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.0 "
5
+ version = " 0.6.10 "
6
6
}
7
7
docker = {
8
8
source = " kreuzwerker/docker"
@@ -58,11 +58,13 @@ provider "coder" {}
58
58
data "coder_workspace" "me" {}
59
59
60
60
resource "coder_agent" "dev" {
61
- arch = " amd64"
62
- os = " linux"
63
- startup_script = << EOF
64
- #!/bin/sh
65
- set -x
61
+ arch = " amd64"
62
+ os = " linux"
63
+
64
+ login_before_ready = false
65
+ startup_script_timeout = 60
66
+ startup_script = <<- EOT
67
+ set -ex
66
68
# install and start code-server
67
69
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
68
70
code-server --auth none --port 13337 &
@@ -73,11 +75,11 @@ resource "coder_agent" "dev" {
73
75
coder dotfiles "$DOTFILES_URI" -y 2>&1 | tee -a ~/.personalize.log
74
76
fi
75
77
if [ -x ~/personalize ]; then
76
- ~/personalize | tee -a ~/.personalize.log
78
+ ~/personalize 2>&1 | tee -a ~/.personalize.log
77
79
elif [ -f ~/personalize ]; then
78
80
echo "~/personalize is not executable, skipping..." | tee -a ~/.personalize.log
79
81
fi
80
- EOF
82
+ EOT
81
83
}
82
84
83
85
resource "coder_app" "code-server" {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ terraform {
6
6
}
7
7
coder = {
8
8
source = " coder/coder"
9
- version = " 0.6.6 "
9
+ version = " 0.6.10 "
10
10
}
11
11
}
12
12
}
@@ -92,15 +92,19 @@ resource "aws_ecs_service" "workspace" {
92
92
data "coder_workspace" "me" {}
93
93
94
94
resource "coder_agent" "coder" {
95
- arch = " amd64"
96
- auth = " token"
97
- os = " linux"
98
- dir = " /home/coder"
99
- startup_script = << EOT
100
- #!/bin/bash
95
+ arch = " amd64"
96
+ auth = " token"
97
+ os = " linux"
98
+ dir = " /home/coder"
99
+
100
+ login_before_ready = false
101
+ startup_script_timeout = 180
102
+ startup_script = <<- EOT
103
+ set -e
104
+
101
105
# install and start code-server
102
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3 | tee code-server-install.log
103
- code-server --auth none --port 13337 | tee code-server-install .log &
106
+ curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
107
+ code-server --auth none --port 13337 >/tmp/ code-server.log 2>&1 &
104
108
EOT
105
109
}
106
110
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
}
8
8
}
@@ -73,15 +73,18 @@ data "aws_ami" "ubuntu" {
73
73
}
74
74
75
75
resource "coder_agent" "main" {
76
- arch = " amd64"
77
- auth = " aws-instance-identity"
78
- os = " linux"
79
- startup_script = << EOT
80
- #!/bin/bash
76
+ arch = " amd64"
77
+ auth = " aws-instance-identity"
78
+ os = " linux"
79
+
80
+ login_before_ready = false
81
+ startup_script_timeout = 180
82
+ startup_script = <<- EOT
83
+ set -e
81
84
82
85
# install and start code-server
83
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3 | tee code-server-install.log
84
- code-server --auth none --port 13337 | tee code-server-install .log &
86
+ curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
87
+ code-server --auth none --port 13337 >/tmp/ code-server.log 2>&1 &
85
88
EOT
86
89
}
87
90
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
}
8
8
}
@@ -73,6 +73,8 @@ resource "coder_agent" "main" {
73
73
arch = " amd64"
74
74
auth = " aws-instance-identity"
75
75
os = " windows"
76
+
77
+ login_before_ready = false
76
78
}
77
79
78
80
locals {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
azurerm = {
8
8
source = " hashicorp/azurerm"
@@ -83,6 +83,8 @@ resource "coder_agent" "main" {
83
83
arch = " amd64"
84
84
os = " linux"
85
85
auth = " azure-instance-identity"
86
+
87
+ login_before_ready = false
86
88
}
87
89
88
90
locals {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
digitalocean = {
8
8
source = " digitalocean/digitalocean"
@@ -96,6 +96,8 @@ data "coder_workspace" "me" {}
96
96
resource "coder_agent" "main" {
97
97
os = " linux"
98
98
arch = " amd64"
99
+
100
+ login_before_ready = false
99
101
}
100
102
101
103
resource "digitalocean_volume" "home_volume" {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
docker = {
8
8
source = " kreuzwerker/docker"
@@ -21,9 +21,15 @@ data "coder_workspace" "me" {
21
21
}
22
22
23
23
resource "coder_agent" "main" {
24
- arch = data. coder_provisioner . me . arch
25
- os = " linux"
26
- startup_script = " code-server --auth none"
24
+ arch = data. coder_provisioner . me . arch
25
+ os = " linux"
26
+
27
+ login_before_ready = false
28
+ startup_script_timeout = 180
29
+ startup_script = <<- EOT
30
+ set -e
31
+ code-server --auth none >/tmp/code-server.log 2>&1 &
32
+ EOT
27
33
28
34
# These environment variables allow you to make Git commits right away after creating a
29
35
# workspace. Note that they take precedence over configuration defined in ~/.gitconfig!
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ terraform {
3
3
required_providers {
4
4
coder = {
5
5
source = " coder/coder"
6
- version = " 0.6.6 "
6
+ version = " 0.6.10 "
7
7
}
8
8
docker = {
9
9
source = " kreuzwerker/docker"
@@ -22,14 +22,17 @@ data "coder_workspace" "me" {
22
22
}
23
23
24
24
resource "coder_agent" "main" {
25
- arch = data. coder_provisioner . me . arch
26
- os = " linux"
27
- startup_script = << EOT
28
- #!/bin/bash
25
+ arch = data. coder_provisioner . me . arch
26
+ os = " linux"
27
+
28
+ login_before_ready = false
29
+ startup_script_timeout = 180
30
+ startup_script = <<- EOT
31
+ set -e
29
32
30
33
# install and start code-server
31
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3 | tee code-server-install.log
32
- code-server --auth none --port 13337 | tee code-server-install .log &
34
+ curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
35
+ code-server --auth none --port 13337 >/tmp/ code-server.log 2>&1 &
33
36
EOT
34
37
}
35
38
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ terraform {
9
9
required_providers {
10
10
coder = {
11
11
source = " coder/coder"
12
- version = " 0.6.6 "
12
+ version = " 0.6.10 "
13
13
}
14
14
docker = {
15
15
source = " kreuzwerker/docker"
@@ -41,9 +41,19 @@ variable "dotfiles_uri" {
41
41
}
42
42
43
43
resource "coder_agent" "main" {
44
- arch = data. coder_provisioner . me . arch
45
- os = " linux"
46
- startup_script = var. dotfiles_uri != " " ? " coder dotfiles -y ${ var . dotfiles_uri } " : null
44
+ arch = data. coder_provisioner . me . arch
45
+ os = " linux"
46
+
47
+ login_before_ready = false
48
+ startup_script_timeout = 180
49
+ env = { " DOTFILES_URI" = var.dotfiles_uri != " " ? var.dotfiles_uri : null }
50
+ startup_script = <<- EOT
51
+ set -e
52
+ if [ -n "$DOTFILES_URI" ]; then
53
+ echo "Installing dotfiles from $DOTFILES_URI"
54
+ coder dotfiles -y "$DOTFILES_URI"
55
+ fi
56
+ EOT
47
57
}
48
58
49
59
resource "docker_volume" "home_volume" {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ RUN apt-get update \
11
11
&& rm -rf /var/lib/apt/lists/*
12
12
13
13
ARG USER=coder
14
- RUN useradd --groups sudo --no-create-home ${USER} \
14
+ RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
15
15
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
16
16
&& chmod 0440 /etc/sudoers.d/${USER}
17
17
USER ${USER}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
docker = {
8
8
source = " kreuzwerker/docker"
@@ -25,14 +25,18 @@ data "coder_workspace" "me" {
25
25
}
26
26
27
27
resource "coder_agent" "main" {
28
- arch = data. coder_provisioner . me . arch
29
- os = " linux"
30
- startup_script = << EOF
31
- #!/bin/sh
28
+ arch = data. coder_provisioner . me . arch
29
+ os = " linux"
30
+
31
+ login_before_ready = false
32
+ startup_script_timeout = 180
33
+ startup_script = <<- EOT
34
+ set -e
35
+
32
36
# install and start code-server
33
37
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
34
- code-server --auth none --port 13337
35
- EOF
38
+ code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
39
+ EOT
36
40
37
41
# These environment variables allow you to make Git commits right away after creating a
38
42
# workspace. Note that they take precedence over configuration defined in ~/.gitconfig!
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
google = {
8
8
source = " hashicorp/google"
@@ -46,15 +46,18 @@ resource "google_compute_disk" "root" {
46
46
}
47
47
48
48
resource "coder_agent" "main" {
49
- auth = " google-instance-identity"
50
- arch = " amd64"
51
- os = " linux"
52
- startup_script = << EOT
53
- #!/bin/bash
49
+ auth = " google-instance-identity"
50
+ arch = " amd64"
51
+ os = " linux"
52
+
53
+ login_before_ready = false
54
+ startup_script_timeout = 180
55
+ startup_script = <<- EOT
56
+ set -e
54
57
55
58
# install and start code-server
56
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3 | tee code-server-install.log
57
- code-server --auth none --port 13337 | tee code-server-install .log &
59
+ curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
60
+ code-server --auth none --port 13337 >/tmp/ code-server.log 2>&1 &
58
61
EOT
59
62
}
60
63
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
google = {
8
8
source = " hashicorp/google"
@@ -36,15 +36,18 @@ data "coder_workspace" "me" {
36
36
}
37
37
38
38
resource "coder_agent" "main" {
39
- auth = " google-instance-identity"
40
- arch = " amd64"
41
- os = " linux"
42
- startup_script = << EOT
43
- #!/bin/bash
39
+ auth = " google-instance-identity"
40
+ arch = " amd64"
41
+ os = " linux"
42
+
43
+ login_before_ready = false
44
+ startup_script_timeout = 180
45
+ startup_script = <<- EOT
46
+ set -e
44
47
45
48
# install and start code-server
46
- curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3 | tee code-server-install.log
47
- code-server --auth none --port 13337 | tee code-server-install .log &
49
+ curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
50
+ code-server --auth none --port 13337 >/tmp/ code-server.log 2>&1 &
48
51
EOT
49
52
}
50
53
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
2
2
required_providers {
3
3
coder = {
4
4
source = " coder/coder"
5
- version = " 0.6.6 "
5
+ version = " 0.6.10 "
6
6
}
7
7
google = {
8
8
source = " hashicorp/google"
@@ -49,6 +49,8 @@ resource "coder_agent" "main" {
49
49
auth = " google-instance-identity"
50
50
arch = " amd64"
51
51
os = " windows"
52
+
53
+ login_before_ready = false
52
54
}
53
55
54
56
resource "google_compute_instance" "dev" {
You can’t perform that action at this time.
0 commit comments