## Description fix module reference in coder-utils <!-- Briefly describe what this PR does and why --> ## Type of Change - [ ] New module - [ ] New template - [x] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information **Path:** `registry/coder/modules/coder-utils` **New version:** `v1.0.1` **Breaking change:** [ ] Yes [x] No ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun fmt`) - [X] Changes tested locally ## Related Issues <!-- Link related issues or write "None" if not applicable -->
1.9 KiB
1.9 KiB
| display_name | description | icon | verified | tags | ||
|---|---|---|---|---|---|---|
| Coder Utils | Building block for modules that need orchestrated script execution | ../../../../.icons/coder.svg | false |
|
Coder Utils
Caution
We do not recommend using this module directly. It is intended primarily for internal use by Coder to create modules with orchestrated script execution.
The Coder Utils module is a building block for modules that need to run multiple scripts in a specific order. It uses coder exp sync for dependency management and is designed for orchestrating pre-install, install, post-install, and start scripts.
Note
- The
agent_nameshould be the same as that of the agentapi module'sagent_nameif used together.
module "coder_utils" {
source = "registry.coder.com/coder/coder-utils/coder"
version = "1.0.1"
agent_id = coder_agent.main.id
agent_name = "myagent"
module_dir_name = ".my-module"
pre_install_script = <<-EOT
#!/bin/bash
echo "Running pre-install tasks..."
# Your pre-install logic here
EOT
install_script = <<-EOT
#!/bin/bash
echo "Installing dependencies..."
# Your install logic here
EOT
post_install_script = <<-EOT
#!/bin/bash
echo "Running post-install configuration..."
# Your post-install logic here
EOT
start_script = <<-EOT
#!/bin/bash
echo "Starting the application..."
# Your start logic here
EOT
}
Execution Order
The module orchestrates scripts in the following order:
- Log File Creation - Creates module directory and log files
- Pre-Install Script (optional) - Runs before installation
- Install Script - Main installation
- Post-Install Script (optional) - Runs after installation
- Start Script - Starts the application
Each script waits for its prerequisites to complete before running using coder exp sync dependency management.