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:
parent
eed8e6c29a
commit
63e28c0e95
@ -15,7 +15,8 @@ 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
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@ -14,10 +14,17 @@ variable "agent_id" {
|
|||||||
description = "The ID of a Coder agent."
|
description = "The ID of a Coder agent."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "start_blocks_login" {
|
||||||
|
type = bool
|
||||||
|
default = false
|
||||||
|
description = "Boolean, This option determines whether users can log in immediately or must wait for the workspace to finish running this script upon startup."
|
||||||
|
}
|
||||||
|
|
||||||
resource "coder_script" "devcontainers-cli" {
|
resource "coder_script" "devcontainers-cli" {
|
||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
display_name = "devcontainers-cli"
|
display_name = "devcontainers-cli"
|
||||||
icon = "/icon/devcontainers.svg"
|
icon = "/icon/devcontainers.svg"
|
||||||
script = templatefile("${path.module}/run.sh", {})
|
script = templatefile("${path.module}/run.sh", {})
|
||||||
run_on_start = true
|
run_on_start = true
|
||||||
|
start_blocks_login = var.start_blocks_login
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user