mirror of
https://github.com/coder/registry.git
synced 2026-06-05 14:08:15 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 19f6dc947f | |||
| 962cd16efd | |||
| 8c130bcb5a | |||
| 516b9ce4ae | |||
| da8e296b1c |
@@ -37,7 +37,7 @@ jobs:
|
|||||||
all:
|
all:
|
||||||
- '**'
|
- '**'
|
||||||
- name: Set up Terraform
|
- name: Set up Terraform
|
||||||
uses: coder/coder/.github/actions/setup-tf@1a774ab7ce99063a2e01beb94de3fcbccaf84dbe # v2.31.5
|
uses: coder/coder/.github/actions/setup-tf@f7650296ceb9b020c79cd525ac7bd3c7f252ae1d # v2.31.6
|
||||||
- name: Set up Bun
|
- name: Set up Bun
|
||||||
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
|
||||||
with:
|
with:
|
||||||
@@ -87,7 +87,7 @@ jobs:
|
|||||||
bun-version: latest
|
bun-version: latest
|
||||||
# Need Terraform for its formatter
|
# Need Terraform for its formatter
|
||||||
- name: Install Terraform
|
- name: Install Terraform
|
||||||
uses: coder/coder/.github/actions/setup-tf@1a774ab7ce99063a2e01beb94de3fcbccaf84dbe # v2.31.5
|
uses: coder/coder/.github/actions/setup-tf@f7650296ceb9b020c79cd525ac7bd3c7f252ae1d # v2.31.6
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
- name: Validate formatting
|
- name: Validate formatting
|
||||||
@@ -106,7 +106,7 @@ jobs:
|
|||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
|
||||||
with:
|
with:
|
||||||
go-version: "1.24.0"
|
go-version: "1.24.0"
|
||||||
- name: Validate contributors
|
- name: Validate contributors
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
|
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
|
||||||
with:
|
with:
|
||||||
go-version: stable
|
go-version: stable
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
bun-version: latest
|
bun-version: latest
|
||||||
|
|
||||||
- name: Set up Terraform
|
- name: Set up Terraform
|
||||||
uses: coder/coder/.github/actions/setup-tf@1a774ab7ce99063a2e01beb94de3fcbccaf84dbe # v2.31.5
|
uses: coder/coder/.github/actions/setup-tf@f7650296ceb9b020c79cd525ac7bd3c7f252ae1d # v2.31.6
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Run [OpenCode](https://opencode.ai) AI coding assistant in your workspace for in
|
|||||||
```tf
|
```tf
|
||||||
module "opencode" {
|
module "opencode" {
|
||||||
source = "registry.coder.com/coder-labs/opencode/coder"
|
source = "registry.coder.com/coder-labs/opencode/coder"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ resource "coder_ai_task" "task" {
|
|||||||
|
|
||||||
module "opencode" {
|
module "opencode" {
|
||||||
source = "registry.coder.com/coder-labs/opencode/coder"
|
source = "registry.coder.com/coder-labs/opencode/coder"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ Run OpenCode as a command-line tool without web interface or task reporting:
|
|||||||
```tf
|
```tf
|
||||||
module "opencode" {
|
module "opencode" {
|
||||||
source = "registry.coder.com/coder-labs/opencode/coder"
|
source = "registry.coder.com/coder-labs/opencode/coder"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder"
|
workdir = "/home/coder"
|
||||||
report_tasks = false
|
report_tasks = false
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ install_opencode() {
|
|||||||
if [ "$ARG_OPENCODE_VERSION" = "latest" ]; then
|
if [ "$ARG_OPENCODE_VERSION" = "latest" ]; then
|
||||||
curl -fsSL https://opencode.ai/install | bash
|
curl -fsSL https://opencode.ai/install | bash
|
||||||
else
|
else
|
||||||
VERSION=$ARG_OPENCODE_VERSION curl -fsSL https://opencode.ai/install | bash
|
curl -fsSL https://opencode.ai/install | VERSION="${ARG_OPENCODE_VERSION}" bash
|
||||||
fi
|
fi
|
||||||
export PATH=/home/coder/.opencode/bin:$PATH
|
export PATH=/home/coder/.opencode/bin:$PATH
|
||||||
printf "Opencode location: %s\n" "$(which opencode)"
|
printf "Opencode location: %s\n" "$(which opencode)"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude
|
|||||||
```tf
|
```tf
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
claude_api_key = "xxxx-xxxxx-xxxx"
|
claude_api_key = "xxxx-xxxxx-xxxx"
|
||||||
@@ -60,7 +60,7 @@ By default, when `enable_boundary = true`, the module uses `coder boundary` subc
|
|||||||
```tf
|
```tf
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
enable_boundary = true
|
enable_boundary = true
|
||||||
@@ -81,7 +81,7 @@ For tasks integration with AI Bridge, add `enable_aibridge = true` to the [Usage
|
|||||||
```tf
|
```tf
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
enable_aibridge = true
|
enable_aibridge = true
|
||||||
@@ -110,7 +110,7 @@ data "coder_task" "me" {}
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
ai_prompt = data.coder_task.me.prompt
|
ai_prompt = data.coder_task.me.prompt
|
||||||
@@ -133,7 +133,7 @@ This example shows additional configuration options for version pinning, custom
|
|||||||
```tf
|
```tf
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ Run and configure Claude Code as a standalone CLI in your workspace.
|
|||||||
```tf
|
```tf
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
install_claude_code = true
|
install_claude_code = true
|
||||||
@@ -211,7 +211,7 @@ variable "claude_code_oauth_token" {
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
claude_code_oauth_token = var.claude_code_oauth_token
|
claude_code_oauth_token = var.claude_code_oauth_token
|
||||||
@@ -284,7 +284,7 @@ resource "coder_env" "bedrock_api_key" {
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
model = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
||||||
@@ -341,7 +341,7 @@ resource "coder_env" "google_application_credentials" {
|
|||||||
|
|
||||||
module "claude-code" {
|
module "claude-code" {
|
||||||
source = "registry.coder.com/coder/claude-code/coder"
|
source = "registry.coder.com/coder/claude-code/coder"
|
||||||
version = "4.8.1"
|
version = "4.8.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
workdir = "/home/coder/project"
|
workdir = "/home/coder/project"
|
||||||
model = "claude-sonnet-4@20250514"
|
model = "claude-sonnet-4@20250514"
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ resource "coder_env" "claude_code_oauth_token" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "coder_env" "claude_api_key" {
|
resource "coder_env" "claude_api_key" {
|
||||||
count = local.claude_api_key != "" ? 1 : 0
|
count = (var.enable_aibridge || (var.claude_api_key != "")) ? 1 : 0
|
||||||
|
|
||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
name = "CLAUDE_API_KEY"
|
name = "CLAUDE_API_KEY"
|
||||||
|
|||||||
@@ -416,7 +416,6 @@ run "test_disable_state_persistence" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
run "test_no_api_key_no_env" {
|
run "test_no_api_key_no_env" {
|
||||||
command = plan
|
command = plan
|
||||||
|
|
||||||
@@ -431,3 +430,18 @@ run "test_no_api_key_no_env" {
|
|||||||
error_message = "CLAUDE_API_KEY should not be created when no API key is provided and aibridge is disabled"
|
error_message = "CLAUDE_API_KEY should not be created when no API key is provided and aibridge is disabled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run "test_api_key_count_with_aibridge_no_override" {
|
||||||
|
command = plan
|
||||||
|
|
||||||
|
variables {
|
||||||
|
agent_id = "test-agent-count"
|
||||||
|
workdir = "/home/coder/test"
|
||||||
|
enable_aibridge = true
|
||||||
|
}
|
||||||
|
|
||||||
|
assert {
|
||||||
|
condition = length(coder_env.claude_api_key) == 1
|
||||||
|
error_message = "CLAUDE_API_KEY env should be created when aibridge is enabled, regardless of session_token value"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
|
|||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -29,7 +29,7 @@ module "code-server" {
|
|||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
install_version = "4.106.3"
|
install_version = "4.106.3"
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
|
|||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
extensions = [
|
extensions = [
|
||||||
"dracula-theme.theme-dracula"
|
"dracula-theme.theme-dracula"
|
||||||
@@ -61,7 +61,7 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
|
|||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
extensions = ["dracula-theme.theme-dracula"]
|
extensions = ["dracula-theme.theme-dracula"]
|
||||||
settings = {
|
settings = {
|
||||||
@@ -72,13 +72,13 @@ module "code-server" {
|
|||||||
|
|
||||||
### Install multiple extensions
|
### Install multiple extensions
|
||||||
|
|
||||||
Just run code-server in the background, don't fetch it from GitHub:
|
Install multiple extensions from [OpenVSX](https://open-vsx.org/) by adding them to the `extensions` list:
|
||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
|
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ You can pass additional command-line arguments to code-server using the `additio
|
|||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
additional_args = "--disable-workspace-trust"
|
additional_args = "--disable-workspace-trust"
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ Run an existing copy of code-server if found, otherwise download from GitHub:
|
|||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
use_cached = true
|
use_cached = true
|
||||||
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
|
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
|
||||||
@@ -121,7 +121,7 @@ Just run code-server in the background, don't fetch it from GitHub:
|
|||||||
module "code-server" {
|
module "code-server" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/code-server/coder"
|
source = "registry.coder.com/coder/code-server/coder"
|
||||||
version = "1.4.3"
|
version = "1.4.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
offline = true
|
offline = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/
|
|||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/dotfiles/coder"
|
source = "registry.coder.com/coder/dotfiles/coder"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -31,7 +31,7 @@ module "dotfiles" {
|
|||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/dotfiles/coder"
|
source = "registry.coder.com/coder/dotfiles/coder"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -42,7 +42,7 @@ module "dotfiles" {
|
|||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/dotfiles/coder"
|
source = "registry.coder.com/coder/dotfiles/coder"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
user = "root"
|
user = "root"
|
||||||
}
|
}
|
||||||
@@ -54,14 +54,14 @@ module "dotfiles" {
|
|||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/dotfiles/coder"
|
source = "registry.coder.com/coder/dotfiles/coder"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
}
|
}
|
||||||
|
|
||||||
module "dotfiles-root" {
|
module "dotfiles-root" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/dotfiles/coder"
|
source = "registry.coder.com/coder/dotfiles/coder"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
user = "root"
|
user = "root"
|
||||||
dotfiles_uri = module.dotfiles.dotfiles_uri
|
dotfiles_uri = module.dotfiles.dotfiles_uri
|
||||||
@@ -90,7 +90,7 @@ You can set a default dotfiles repository for all users by setting the `default_
|
|||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
count = data.coder_workspace.me.start_count
|
count = data.coder_workspace.me.start_count
|
||||||
source = "registry.coder.com/coder/dotfiles/coder"
|
source = "registry.coder.com/coder/dotfiles/coder"
|
||||||
version = "1.4.0"
|
version = "1.4.1"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
default_dotfiles_uri = "https://github.com/coder/dotfiles"
|
default_dotfiles_uri = "https://github.com/coder/dotfiles"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,21 @@ describe("dotfiles", async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("command uses bash for fish shell compatibility", async () => {
|
||||||
|
const state = await runTerraformApply(import.meta.dir, {
|
||||||
|
agent_id: "foo",
|
||||||
|
manual_update: "true",
|
||||||
|
dotfiles_uri: "https://github.com/test/dotfiles",
|
||||||
|
});
|
||||||
|
|
||||||
|
const app = state.resources.find(
|
||||||
|
(r) => r.type === "coder_app" && r.name === "dotfiles",
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(app).toBeDefined();
|
||||||
|
expect(app?.instances[0]?.attributes?.command).toContain("/bin/bash -c");
|
||||||
|
});
|
||||||
|
|
||||||
it("set custom order for coder_parameter", async () => {
|
it("set custom order for coder_parameter", async () => {
|
||||||
const order = 99;
|
const order = 99;
|
||||||
const state = await runTerraformApply(import.meta.dir, {
|
const state = await runTerraformApply(import.meta.dir, {
|
||||||
|
|||||||
@@ -164,12 +164,12 @@ resource "coder_app" "dotfiles" {
|
|||||||
icon = "/icon/dotfiles.svg"
|
icon = "/icon/dotfiles.svg"
|
||||||
order = var.order
|
order = var.order
|
||||||
group = var.group
|
group = var.group
|
||||||
command = templatefile("${path.module}/run.sh", {
|
command = "/bin/bash -c \"$(echo ${base64encode(templatefile("${path.module}/run.sh", {
|
||||||
DOTFILES_URI : local.dotfiles_uri,
|
DOTFILES_URI : local.dotfiles_uri,
|
||||||
DOTFILES_USER : local.user,
|
DOTFILES_USER : local.user,
|
||||||
DOTFILES_BRANCH : local.dotfiles_branch,
|
DOTFILES_BRANCH : local.dotfiles_branch,
|
||||||
POST_CLONE_SCRIPT : local.encoded_post_clone_script
|
POST_CLONE_SCRIPT : local.encoded_post_clone_script
|
||||||
})
|
}))} | base64 -d)\""
|
||||||
}
|
}
|
||||||
|
|
||||||
output "dotfiles_uri" {
|
output "dotfiles_uri" {
|
||||||
|
|||||||
Reference in New Issue
Block a user