Enable Devcontainer-cli module to block user login until script finishes running (#759)

## Description
Allow for devcontainer-cli module to prevent users from logging in until
its finished running.

## Type of Change

- [ ] New module
- [ ] New template
- [ ] Bug fix
- [x ] Feature/enhancement
- [ ] Documentation
- [ ] Other

## Module Information

**Path:** `registry/coder/modules/devcontainers-cli`  
**New version:** `1.1.0`  
**Breaking change:** [ ] Yes [x ] No

## Testing & Validation

- [x] Tests pass (`bun test`)
- [ ] Code formatted (`bun fmt`)
- [ x] Changes tested locally

## Related Issues
None

---------

Co-authored-by: DevCats <chris@dualriver.com>
Co-authored-by: DevCats <christofer@coder.com>
This commit is contained in:
justmanuel 2026-03-03 16:01:05 -05:00 committed by GitHub
parent eed8e6c29a
commit 63e28c0e95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 9 deletions

View File

@ -14,8 +14,9 @@ The devcontainers-cli module provides an easy way to install [`@devcontainers/cl
```tf ```tf
module "devcontainers-cli" { module "devcontainers-cli" {
source = "registry.coder.com/coder/devcontainers-cli/coder" source = "registry.coder.com/coder/devcontainers-cli/coder"
version = "1.0.34" version = "1.1.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
start_blocks_login = false
} }
``` ```

View File

@ -14,10 +14,17 @@ variable "agent_id" {
description = "The ID of a Coder agent." description = "The ID of a Coder agent."
} }
resource "coder_script" "devcontainers-cli" { variable "start_blocks_login" {
agent_id = var.agent_id type = bool
display_name = "devcontainers-cli" default = false
icon = "/icon/devcontainers.svg" description = "Boolean, This option determines whether users can log in immediately or must wait for the workspace to finish running this script upon startup."
script = templatefile("${path.module}/run.sh", {}) }
run_on_start = true
resource "coder_script" "devcontainers-cli" {
agent_id = var.agent_id
display_name = "devcontainers-cli"
icon = "/icon/devcontainers.svg"
script = templatefile("${path.module}/run.sh", {})
run_on_start = true
start_blocks_login = var.start_blocks_login
} }