69 lines
2.1 KiB
HCL
69 lines
2.1 KiB
HCL
locals {
|
|
core_scripts = {
|
|
workspace = {
|
|
display = "Setup Development Workspace"
|
|
icon = "/icon/container.svg"
|
|
path = "${path.module}/scripts/workspace-setup.sh"
|
|
}
|
|
dev_tools = {
|
|
display = "Install Development Tools"
|
|
icon = "/icon/code.svg"
|
|
path = "${path.module}/scripts/dev-tools.sh"
|
|
}
|
|
git_hooks = {
|
|
display = "Configure Git Hooks"
|
|
icon = "/icon/git.svg"
|
|
path = "${path.module}/scripts/git-hooks.sh"
|
|
}
|
|
}
|
|
|
|
ai_scripts = {
|
|
claude = {
|
|
enabled = data.coder_parameter.enable_ai_tools.value && var.install_claude_code
|
|
display = "Install Claude CLI"
|
|
icon = "/icon/claude.svg"
|
|
path = "${path.module}/scripts/claude-install.sh"
|
|
}
|
|
codex = {
|
|
enabled = data.coder_parameter.enable_ai_tools.value && var.install_codex_support
|
|
display = "Install Codex CLI"
|
|
icon = "/icon/code.svg"
|
|
path = "${path.module}/scripts/codex-setup.sh"
|
|
}
|
|
cursor = {
|
|
enabled = data.coder_parameter.enable_ai_tools.value && var.install_cursor_support
|
|
display = "Configure Cursor"
|
|
icon = "/icon/cursor.svg"
|
|
path = "${path.module}/scripts/cursor-setup.sh"
|
|
}
|
|
windsurf = {
|
|
enabled = data.coder_parameter.enable_ai_tools.value && var.install_windsurf_support
|
|
display = "Configure Windsurf"
|
|
icon = "/icon/windsurf.svg"
|
|
path = "${path.module}/scripts/windsurf-setup.sh"
|
|
}
|
|
}
|
|
}
|
|
|
|
resource "coder_script" "core" {
|
|
for_each = local.core_scripts
|
|
|
|
agent_id = coder_agent.main.id
|
|
display_name = each.value.display
|
|
icon = each.value.icon
|
|
run_on_start = true
|
|
|
|
script = "echo '${base64encode(file(each.value.path))}' | base64 -d | tr -d '\\r' | bash"
|
|
}
|
|
|
|
resource "coder_script" "ai" {
|
|
for_each = { for key, value in local.ai_scripts : key => value if value.enabled }
|
|
|
|
agent_id = coder_agent.main.id
|
|
display_name = each.value.display
|
|
icon = each.value.icon
|
|
run_on_start = true
|
|
|
|
script = "echo '${base64encode(file(each.value.path))}' | base64 -d | tr -d '\\r' | bash"
|
|
}
|