From 1ee66136d376759877de913efff11bd0198b4757 Mon Sep 17 00:00:00 2001 From: Mark Milligan Date: Sat, 30 Jul 2022 13:16:39 -0500 Subject: [PATCH] chore: document startup_script and agent log location --- docs/templates.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/docs/templates.md b/docs/templates.md index b39f25c567852..e7122a191e99f 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -95,6 +95,45 @@ The `coder_agent` resource can be configured as described in the For example, you can use the `env` property to set environment variables that will be inherited by all child processes of the agent, including SSH sessions. +#### startup_script + +Use the Coder agent's `startup_script` to run additional commands like +installing IDEs and clone dotfile and project repos. In this example, the +project and dotfile repos are specified as Terraform input variables elsewhere +in the `main.tf` Note the `&` after the `code-server` start to execute +`code-server` process in the background so the `startup_script` can continue +with the repo cloning steps. + +```hcl +resource "coder_agent" "coder" { + os = "linux" + arch = "amd64" + dir = "/home/coder" + startup_script = <> ~/.ssh/known_hosts +git clone --progress git@github.com:${var.repo} + +# use coder CLI to clone and install dotfiles +coder dotfiles -y ${var.dotfiles_uri} + + EOT +} +``` + +#### Logging + +The output of the `startup_script` are located in +`/tmp/coder-startup-script.log` within the workspace. + +The Coder agent log is located in `/tmp/coder-agent.log` within the workspace. + ### Parameters Templates often contain _parameters_. These are defined by `variable` blocks in pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy