mirror of
https://github.com/coder/registry.git
synced 2026-06-02 20:48:14 +00:00
chore(examples): add MODULE_NAME.tftest.hcl to new module sample and make run.sh optional
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
run "plan_with_required_vars" {
|
||||
command = plan
|
||||
|
||||
variables {
|
||||
agent_id = "example-agent-id"
|
||||
}
|
||||
}
|
||||
|
||||
run "app_url_uses_port" {
|
||||
command = plan
|
||||
|
||||
variables {
|
||||
agent_id = "example-agent-id"
|
||||
port = 19999
|
||||
}
|
||||
|
||||
assert {
|
||||
condition = resource.coder_app.MODULE_NAME.url == "http://localhost:19999"
|
||||
error_message = "Expected MODULE_NAME app URL to include configured port"
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ if [ -d "registry/$NAMESPACE/modules/$MODULE_NAME" ]; then
|
||||
fi
|
||||
mkdir -p "registry/${NAMESPACE}/modules/${MODULE_NAME}"
|
||||
|
||||
# Copy required files from the example module
|
||||
# Copy required files from the example module (includes Terraform tests)
|
||||
cp -r examples/modules/* "registry/${NAMESPACE}/modules/${MODULE_NAME}/"
|
||||
|
||||
# Change to module directory
|
||||
@@ -48,5 +48,7 @@ else
|
||||
sed -i "s/MODULE_NAME/${MODULE_NAME}/g" README.md
|
||||
fi
|
||||
|
||||
# Make run.sh executable
|
||||
chmod +x run.sh
|
||||
# Make run.sh executable (if present)
|
||||
if [ -f run.sh ]; then
|
||||
chmod +x run.sh
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user