add CI config

This commit is contained in:
anthorob committed 2025-07-08 12:09:51 -04:00
1 parent 4ab9a392d6
commit d9b1b0f6fd
3 files changed
+55 -1

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
stages:
- generate
generate-child-pipeline:
stage: generate
image: alpine:latest
script:
- apk add --no-cache bash
- ./ci-scripts/generate-pipeline.sh > child-pipeline.yml
artifacts:
paths:
- child-pipeline.yml
trigger:
include:
- artifact: child-pipeline.yml
job: generate-child-pipeline
strategy: depend
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
set -euo pipefail
echo "stages:"
echo " - validate"
echo " - deploy"
for dir in templates/*; do
[ -d "$dir" ] || continue
name=$(basename "$dir")
cat <<EOF
validate_${name}:
stage: validate
image: hashicorp/terraform:1.6
script:
- terraform -chdir=$dir init -backend=false
- terraform -chdir=$dir validate
only:
changes:
- $dir/**
deploy_${name}:
stage: deploy
image: registry.bobert.me/anthorob/coder-images:coder-cli
script:
- cd $dir
- coder templates push ${name} --tag "${CI_COMMIT_SHORT_SHA}" --description "Auto-deployed from ${CI_PROJECT_PATH} on commit ${CI_COMMIT_SHORT_SHA}" --latest --yes
only:
refs:
- main
changes:
- $dir/**
EOF
done
+1 -1
View File
@@ -1,4 +1,4 @@
variable "language" {
variable "language" { ## construct docker image with this?
description = "Language label for metadata"
type = string
}