Complete rewrite of the module to deploy a Renovate bot for automated dependency management with Gitea integration. Breaking Changes: - Module purpose changed from Ansible EDA to Renovate bot - All variables restructured for Renovate configuration - State file path updated to home/docker/renovate/renovate.tfstate - Volumes changed from EDA rulebooks/logs to config/cache - Container image now uses renovate/renovate:latest Added: - Gitea platform integration with token authentication - Renovate configuration template (config.js.tpl) - Repository configuration examples - Gitea Actions workflow examples - SonarQube integration examples - Comprehensive documentation (README, QUICKSTART, MIGRATION_GUIDE) - CHANGELOG.md for version tracking - Security best practices Removed: - All Ansible EDA-specific configuration - Traefik labels (not needed for Renovate) - Old EDA documentation files - example-rulebook.yml Updated: - Complete README with Gitea setup instructions - terraform.tfvars with Renovate configuration - All resource names from ansible_eda to renovate - Backend state path This is version 2.0.0 - not backward compatible with previous EDA version. See MIGRATION_GUIDE.md for detailed migration instructions.
95 lines
2.4 KiB
HCL
95 lines
2.4 KiB
HCL
# Get Traefik network
|
|
data "docker_network" "traefik_network" {
|
|
name = "traefik_network"
|
|
}
|
|
|
|
# Create volumes for Renovate
|
|
resource "docker_volume" "renovate_config" {
|
|
name = "renovate-config"
|
|
}
|
|
|
|
resource "docker_volume" "renovate_cache" {
|
|
name = "renovate-cache"
|
|
}
|
|
|
|
# Pull Renovate image
|
|
resource "docker_image" "renovate" {
|
|
name = var.renovate_image
|
|
keep_locally = true
|
|
}
|
|
|
|
# Create Renovate container
|
|
resource "docker_container" "renovate" {
|
|
image = docker_image.renovate.image_id
|
|
name = var.container_name
|
|
hostname = var.container_name
|
|
restart = var.restart_policy
|
|
|
|
# Resource limits
|
|
memory = var.memory_limit
|
|
memory_swap = var.memory_swap_limit
|
|
|
|
# Environment variables for Renovate
|
|
env = concat(
|
|
[
|
|
"RENOVATE_PLATFORM=${var.renovate_platform}",
|
|
"RENOVATE_ENDPOINT=${var.renovate_endpoint}",
|
|
"RENOVATE_TOKEN=${var.renovate_token}",
|
|
"RENOVATE_GIT_AUTHOR=${var.renovate_git_author}",
|
|
"RENOVATE_AUTODISCOVER=${var.renovate_autodiscover}",
|
|
"LOG_LEVEL=${var.log_level}"
|
|
],
|
|
var.github_com_token != "" ? ["GITHUB_COM_TOKEN=${var.github_com_token}"] : [],
|
|
var.extra_env_vars
|
|
)
|
|
|
|
# Network configuration
|
|
networks_advanced {
|
|
name = data.docker_network.traefik_network.name
|
|
}
|
|
|
|
# Volumes
|
|
volumes {
|
|
volume_name = docker_volume.renovate_config.name
|
|
container_path = "/usr/src/app/config"
|
|
}
|
|
|
|
volumes {
|
|
volume_name = docker_volume.renovate_cache.name
|
|
container_path = "/tmp/renovate"
|
|
}
|
|
|
|
# Upload config.js if enabled
|
|
dynamic "upload" {
|
|
for_each = var.upload_config_file ? [1] : []
|
|
content {
|
|
content = templatefile("${path.module}/files/config.js.tpl", {
|
|
platform = var.renovate_platform
|
|
endpoint = var.renovate_endpoint
|
|
git_author = var.renovate_git_author
|
|
username = var.renovate_username
|
|
autodiscover = var.renovate_autodiscover
|
|
onboarding_config = var.renovate_onboarding_config
|
|
})
|
|
file = "/usr/src/app/config.js"
|
|
}
|
|
}
|
|
|
|
lifecycle {
|
|
ignore_changes = [
|
|
command,
|
|
entrypoint
|
|
]
|
|
}
|
|
}
|
|
|
|
# DNS CNAME record for Renovate (optional, if web interface is needed)
|
|
resource "dns_cname_record" "renovate_cname" {
|
|
count = var.create_cname_record ? 1 : 0
|
|
|
|
zone = "${var.domain}."
|
|
ttl = 300
|
|
name = coalesce(var.dns_name, var.container_name)
|
|
cname = "hosting.${var.domain}."
|
|
}
|