Skip to content

feat(dogfood/coder): add devcontainer autostart parameter #18459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions dogfood/coder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ data "coder_parameter" "res_mon_volume_path" {
mutable = true
}

data "coder_parameter" "devcontainer_autostart" {
type = "bool"
name = "Automatically start devcontainer for coder/coder"
default = false
description = "If enabled, a devcontainer will be automatically started for the [coder/coder](https://github.com/coder/coder) repository."
mutable = true
}

provider "docker" {
host = lookup(local.docker_host, data.coder_parameter.region.value)
}
Expand Down Expand Up @@ -502,6 +510,12 @@ resource "coder_agent" "dev" {
EOT
}

resource "coder_devcontainer" "coder" {
count = data.coder_parameter.devcontainer_autostart.value ? data.coder_workspace.me.start_count : 0
agent_id = coder_agent.dev.id
workspace_folder = local.repo_dir
}

# Add a cost so we get some quota usage in dev.coder.com
resource "coder_metadata" "home_volume" {
resource_id = docker_volume.home_volume.id
Expand Down
Loading