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

Commita86c957

Browse files
authored
feat: set /Users/spike for coder agent in gcp-linux template (#2147)
Signed-off-by: Spike Curtis <spike@coder.com>
1 parent3bc122b commita86c957

File tree

1 file changed

+17
-1
lines changed
  • examples/templates/gcp-linux

1 file changed

+17
-1
lines changed

‎examples/templates/gcp-linux/main.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,21 @@ resource "google_compute_instance" "dev" {
7070
email=data.google_compute_default_service_account.default.email
7171
scopes=["cloud-platform"]
7272
}
73-
metadata_startup_script=coder_agent.dev.init_script
73+
# The startup script runs as root with no $HOME environment set up, which can break workspace applications, so
74+
# instead of directly running the agent init script, setup the home directory, write the init script, and then execute
75+
# it.
76+
metadata_startup_script=<<EOMETA
77+
#!/usr/bin/env sh
78+
set -eux pipefail
79+
80+
mkdir /root || true
81+
cat <<'EOCODER' > /root/coder_agent.sh
82+
${coder_agent.dev.init_script}
83+
EOCODER
84+
chmod +x /root/coder_agent.sh
85+
86+
export HOME=/root
87+
/root/coder_agent.sh
88+
89+
EOMETA
7490
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp