feat(examples/templates/kubernetes-devcontainer): switch code-server to a module and add JetBrains (#15545)

This commit is contained in:
Phorcys
2024-12-21 12:38:29 +01:00
committed by GitHub
parent 5786a13ac9
commit c41d7c38ae

View File

@ -334,12 +334,7 @@ resource "coder_agent" "main" {
startup_script = <<-EOT startup_script = <<-EOT
set -e set -e
# Install the latest code-server. # Add any commands that should be executed at workspace startup (e.g install requirements, start a program, etc) here
# Append "--version x.x.x" to install a specific version of code-server.
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
# Start code-server in the background.
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
EOT EOT
dir = "/workspaces" dir = "/workspaces"
@ -421,20 +416,36 @@ resource "coder_agent" "main" {
} }
} }
resource "coder_app" "code-server" { # See https://registry.coder.com/modules/code-server
agent_id = coder_agent.main.id module "code-server" {
slug = "code-server" count = data.coder_workspace.me.start_count
display_name = "code-server" source = "registry.coder.com/modules/code-server/coder"
url = "http://localhost:13337/?folder=/workspaces"
icon = "/icon/code.svg"
subdomain = false
share = "owner"
healthcheck { # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
url = "http://localhost:13337/healthz" version = ">= 1.0.0"
interval = 5
threshold = 6 agent_id = coder_agent.main.id
order = 1
} }
# See https://registry.coder.com/modules/jetbrains-gateway
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder"
# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["IU", "PY", "WS", "PS", "RD", "CL", "GO", "RM"]
default = "IU"
# Default folder to open when starting a JetBrains IDE
folder = "/home/coder"
# This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
version = ">= 1.0.0"
agent_id = coder_agent.main.id
agent_name = "main"
order = 2
} }
resource "coder_metadata" "container_info" { resource "coder_metadata" "container_info" {