Make each Coder template self-contained (fix coder templates push failure)
Provision Coder Templates / provision (push) Successful in 2m10s
Provision Coder Templates / provision (push) Successful in 2m10s
coder templates push -d templates/<env> only uploads that directory to the
Coder server, so main.tf's file() references reaching outside it via
../../profile-templates and ../../scripts failed at push/apply time
("Invalid function argument ... this function works only with files that
are distributed as part of the configuration source code"). Confirmed via
an actual failed run of coder-templates.yml once the runner network fix let
it get that far.
Fix: duplicate profile.code-profile, cli-setup-wizard.sh, and
install-skills.sh into each templates/<env>/ directory and drop the old
shared scripts/ and profile-templates/ directories.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ terraform {
|
||||
|
||||
locals {
|
||||
env_name = "Default"
|
||||
profile = jsondecode(file("${path.module}/../../profile-templates/Default.code-profile"))
|
||||
profile = jsondecode(file("${path.module}/profile.code-profile"))
|
||||
settings_raw = jsondecode(local.profile.settings).settings
|
||||
extensions = [for e in jsondecode(local.profile.extensions) : e.identifier.id]
|
||||
}
|
||||
@@ -243,7 +243,7 @@ resource "coder_script" "apply_settings" {
|
||||
|
||||
# Drops the shared CLI setup wizard onto the workspace and hooks it into
|
||||
# every new interactive shell (via .bashrc) until the user completes it.
|
||||
# See ../../scripts/cli-setup-wizard.sh for what it actually asks.
|
||||
# See ./cli-setup-wizard.sh for what it actually asks.
|
||||
resource "coder_script" "cli_setup_wizard" {
|
||||
agent_id = coder_agent.main.id
|
||||
display_name = "Install CLI Setup Wizard"
|
||||
@@ -252,7 +252,7 @@ resource "coder_script" "cli_setup_wizard" {
|
||||
#!/bin/bash
|
||||
set -e
|
||||
mkdir -p /opt/coder
|
||||
echo '${base64encode(file("${path.module}/../../scripts/cli-setup-wizard.sh"))}' | base64 -d > /opt/coder/cli-setup-wizard.sh
|
||||
echo '${base64encode(file("${path.module}/cli-setup-wizard.sh"))}' | base64 -d > /opt/coder/cli-setup-wizard.sh
|
||||
chmod +x /opt/coder/cli-setup-wizard.sh
|
||||
|
||||
MARKER="# >>> coder cli setup wizard >>>"
|
||||
@@ -297,7 +297,7 @@ resource "coder_script" "install_bun" {
|
||||
}
|
||||
|
||||
# Installs this repo's Agent Skills into Claude Code, GitHub Copilot CLI, and
|
||||
# Antigravity CLI's skills directories. See ../../scripts/install-skills.sh.
|
||||
# Antigravity CLI's skills directories. See ./install-skills.sh.
|
||||
# Default has no matching entry in extensions/custom-specialty-plugin/skills,
|
||||
# so it only gets the common awesome-skills-plugin bundle.
|
||||
resource "coder_script" "install_skills" {
|
||||
@@ -308,7 +308,7 @@ resource "coder_script" "install_skills" {
|
||||
#!/bin/bash
|
||||
set -e
|
||||
mkdir -p /opt/coder
|
||||
echo '${base64encode(file("${path.module}/../../scripts/install-skills.sh"))}' | base64 -d > /opt/coder/install-skills.sh
|
||||
echo '${base64encode(file("${path.module}/install-skills.sh"))}' | base64 -d > /opt/coder/install-skills.sh
|
||||
chmod +x /opt/coder/install-skills.sh
|
||||
SPECIALTY_SKILLS="" /opt/coder/install-skills.sh
|
||||
EOT
|
||||
|
||||
Reference in New Issue
Block a user