@@ -98,11 +98,7 @@ inherited by all child processes of the agent, including SSH sessions.
98
98
#### startup_script
99
99
100
100
Use the Coder agent's ` startup_script ` to run additional commands like
101
- installing IDEs and clone dotfile and project repos. In this example, the
102
- project and dotfile repos are specified as Terraform input variables elsewhere
103
- in the ` main.tf ` Note the ` & ` after the ` code-server ` start to execute
104
- ` code-server ` process in the background so the ` startup_script ` can continue
105
- with the repo cloning steps.
101
+ installing IDEs, [ cloning dotfile] ( ./dotfiles.md#templates ) , and cloning project repos.
106
102
107
103
``` hcl
108
104
resource "coder_agent" "coder" {
@@ -113,27 +109,27 @@ resource "coder_agent" "coder" {
113
109
#!/bin/bash
114
110
115
111
# install code-server
116
- curl -fsSL https://code-server.dev/install.sh | sh
112
+ curl -fsSL https://code-server.dev/install.sh | sh
113
+
114
+ # The & prevents the startup_script from blocking so the
115
+ # next commands can run.
117
116
code-server --auth none --port &
118
117
118
+ # var.repo and var.dotfiles_uri is specified
119
+ # elsewhere in the Terraform code as input
120
+ # variables.
121
+
119
122
# clone repo
120
123
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
121
124
git clone --progress git@github.com:${var.repo}
122
125
123
126
# use coder CLI to clone and install dotfiles
124
127
coder dotfiles -y ${var.dotfiles_uri}
125
128
126
- EOT
129
+ EOT
127
130
}
128
131
```
129
132
130
- #### Logging
131
-
132
- The output of the ` startup_script ` are located in
133
- ` /tmp/coder-startup-script.log ` within the workspace.
134
-
135
- The Coder agent log is located in ` /tmp/coder-agent.log ` within the workspace.
136
-
137
133
### Parameters
138
134
139
135
Templates often contain _ parameters_ . These are defined by ` variable ` blocks in
0 commit comments