1 Commits

Author SHA1 Message Date
unkinben cee451f741 feat: add terraform-git
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline was successful
- add new repo
- change write -> none
2026-06-11 00:52:50 +10:00
12 changed files with 34 additions and 69 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ steps:
VAULT_AUTH_METHOD: kubernetes
commands:
- dnf install vault -y
- make apply-if-changes
- make plan
- make apply
backend_options:
kubernetes:
serviceAccountName: terraform-git
+1 -17
View File
@@ -1,4 +1,4 @@
.PHONY: init plan apply apply-if-changes format pre-commit
.PHONY: init plan apply format
VAULT_AUTH_METHOD ?= approle
VAULT_K8S_ROLE ?= woodpecker_terraform_git
@@ -25,19 +25,6 @@ plan: init
@$(call vault_env) && \
terragrunt run --all --parallelism 4 --non-interactive plan
apply-if-changes: init
@$(call vault_env) && \
terragrunt run --all --parallelism 4 --non-interactive plan -- -detailed-exitcode -out=tfplan; \
EXIT_CODE=$$?; \
if [ $$EXIT_CODE -eq 2 ]; then \
$(call vault_env) && \
terragrunt run --all --parallelism 2 --non-interactive apply -- tfplan; \
elif [ $$EXIT_CODE -eq 0 ]; then \
echo "No changes detected, skipping apply."; \
else \
exit $$EXIT_CODE; \
fi
apply: init
@$(call vault_env) && \
terragrunt run --all --parallelism 2 --non-interactive apply
@@ -47,6 +34,3 @@ format:
@tofu fmt -recursive .
@echo "Formatting Terragrunt files..."
@terragrunt hcl fmt
pre-commit:
@uvx pre-commit run --all-files
@@ -1,2 +0,0 @@
description: "Base container image for forgebot agents"
private: false
@@ -1,2 +0,0 @@
description: "Dev toolchain container for forgebot agents"
private: false
@@ -1,2 +0,0 @@
description: "Infrastructure toolchain container for forgebot agents"
private: false
@@ -1,2 +0,0 @@
description: "Skill definitions for forgebot agents"
private: false
@@ -1,2 +0,0 @@
description: "K8s operator + API for AI agent dispatch from git forges"
private: false
+1
View File
@@ -20,5 +20,6 @@ inputs = {
organisation = local.config.organisation
repository = local.config.repository
branch_protection = local.config.branch_protection
deploy_key = local.config.deploy_key
team = local.config.team
}
+15
View File
@@ -19,6 +19,21 @@ terraform {
lock = true
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
}
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
woodpecker = {
source = "Kichiyaki/woodpecker"
version = "0.5.0"
}
consul = {
source = "hashicorp/consul"
version = "2.23.0"
}
}
}
EOF
}
-25
View File
@@ -143,31 +143,6 @@ import {
id = "137"
}
import {
to = module.repository["git.unkin.net/unkin/forgebot"].gitea_repository.this
id = "139"
}
import {
to = module.repository["git.unkin.net/unkin/forgebot-skills"].gitea_repository.this
id = "140"
}
import {
to = module.repository["git.unkin.net/unkin/container-agent-base"].gitea_repository.this
id = "141"
}
import {
to = module.repository["git.unkin.net/unkin/container-agent-dev"].gitea_repository.this
id = "142"
}
import {
to = module.repository["git.unkin.net/unkin/container-agent-infra"].gitea_repository.this
id = "143"
}
import {
to = module.team["git.unkin.net/unkin/Owners"].gitea_team.this
id = "3"
-13
View File
@@ -1,13 +0,0 @@
terraform {
required_version = ">= 1.10"
required_providers {
gitea = {
source = "go-gitea/gitea"
version = "0.7.0"
}
woodpecker = {
source = "Kichiyaki/woodpecker"
version = "0.5.0"
}
}
}
+15 -3
View File
@@ -15,8 +15,8 @@ variable "organisation" {
variable "repository" {
description = "Map of repositories to create"
type = map(object({
name = string
organisation = string
name = string
organisation = string
description = optional(string)
private = optional(bool)
default_branch = optional(string)
@@ -32,7 +32,7 @@ variable "repository" {
repo_template = optional(bool)
website = optional(string)
autodetect_manual_merge = optional(bool)
woodpecker = optional(bool, false)
woodpecker = optional(bool, false)
}))
default = {}
}
@@ -64,6 +64,18 @@ variable "branch_protection" {
default = {}
}
variable "deploy_key" {
description = "Map of deploy keys to create"
type = map(object({
repository = string
organisation = string
gitea_url = string
title = string
key = string
read_only = optional(bool, true)
}))
default = {}
}
variable "team" {
description = "Map of teams to create"