From 68f42acae6f7608ceb8f75ec0e27c6d185bc107a Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Sat, 24 Oct 2026 17:43:05 +1100 Subject: [PATCH] Add alpine-internal local and alpine-custom virtual --- config/config.hcl | 10 ++++ config/local_alpine/alpine-internal.yaml | 1 + config/virtual/alpine-custom.yaml | 4 ++ .../terragrunt.hcl | 56 ++++++++++--------- modules/artifactapi/main.tf | 21 +++++++ modules/artifactapi/variables.tf | 21 +++++++ 6 files changed, 86 insertions(+), 27 deletions(-) create mode 100644 config/local_alpine/alpine-internal.yaml create mode 100644 config/virtual/alpine-custom.yaml diff --git a/config/config.hcl b/config/config.hcl index 6cdbc26..d435516 100644 --- a/config/config.hcl +++ b/config/config.hcl @@ -42,6 +42,11 @@ locals { trimsuffix(basename(file_path), ".yaml") => content if startswith(file_path, "remote_github_deb/") } + remote_github_alpine = { + for file_path, content in local.all_configs : + trimsuffix(basename(file_path), ".yaml") => content + if startswith(file_path, "remote_github_alpine/") + } remote_github_rpm = { for file_path, content in local.all_configs : trimsuffix(basename(file_path), ".yaml") => content @@ -102,6 +107,11 @@ locals { trimsuffix(basename(file_path), ".yaml") => content if startswith(file_path, "local_deb/") } + local_alpine = { + for file_path, content in local.all_configs : + trimsuffix(basename(file_path), ".yaml") => content + if startswith(file_path, "local_alpine/") + } local_npm = { for file_path, content in local.all_configs : trimsuffix(basename(file_path), ".yaml") => content diff --git a/config/local_alpine/alpine-internal.yaml b/config/local_alpine/alpine-internal.yaml new file mode 100644 index 0000000..acef2cf --- /dev/null +++ b/config/local_alpine/alpine-internal.yaml @@ -0,0 +1 @@ +description: "Internal Alpine packages" diff --git a/config/virtual/alpine-custom.yaml b/config/virtual/alpine-custom.yaml new file mode 100644 index 0000000..312812f --- /dev/null +++ b/config/virtual/alpine-custom.yaml @@ -0,0 +1,4 @@ +package_type: alpine +description: "Custom apk repo: internal packages. Member order is priority order." +members: + - alpine-internal diff --git a/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl b/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl index 9e600bc..26d086d 100644 --- a/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl +++ b/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl @@ -17,31 +17,33 @@ terraform { } inputs = { - remote_alpine = local.config.remote_alpine - remote_ansible = local.config.remote_ansible - remote_cargo = local.config.remote_cargo - remote_docker = local.config.remote_docker - remote_generic = local.config.remote_generic - remote_gems = local.config.remote_gems - remote_github_deb = local.config.remote_github_deb - remote_github_rpm = local.config.remote_github_rpm - remote_goproxy = local.config.remote_goproxy - remote_helm = local.config.remote_helm - remote_npm = local.config.remote_npm - remote_puppet = local.config.remote_puppet - remote_pypi = local.config.remote_pypi - remote_rpm = local.config.remote_rpm - local_terraform = local.config.local_terraform - local_pypi = local.config.local_pypi - local_rpm = local.config.local_rpm - local_helm = local.config.local_helm - local_deb = local.config.local_deb - local_npm = local.config.local_npm - local_goproxy = local.config.local_goproxy - local_gems = local.config.local_gems - local_ansible = local.config.local_ansible - local_puppet = local.config.local_puppet - local_docker = local.config.local_docker - local_generic = local.config.local_generic - virtual = local.config.virtual + remote_alpine = local.config.remote_alpine + remote_ansible = local.config.remote_ansible + remote_cargo = local.config.remote_cargo + remote_docker = local.config.remote_docker + remote_generic = local.config.remote_generic + remote_gems = local.config.remote_gems + remote_github_deb = local.config.remote_github_deb + remote_github_alpine = local.config.remote_github_alpine + remote_github_rpm = local.config.remote_github_rpm + remote_goproxy = local.config.remote_goproxy + remote_helm = local.config.remote_helm + remote_npm = local.config.remote_npm + remote_puppet = local.config.remote_puppet + remote_pypi = local.config.remote_pypi + remote_rpm = local.config.remote_rpm + local_terraform = local.config.local_terraform + local_pypi = local.config.local_pypi + local_rpm = local.config.local_rpm + local_helm = local.config.local_helm + local_deb = local.config.local_deb + local_alpine = local.config.local_alpine + local_npm = local.config.local_npm + local_goproxy = local.config.local_goproxy + local_gems = local.config.local_gems + local_ansible = local.config.local_ansible + local_puppet = local.config.local_puppet + local_docker = local.config.local_docker + local_generic = local.config.local_generic + virtual = local.config.virtual } diff --git a/modules/artifactapi/main.tf b/modules/artifactapi/main.tf index d62f279..f7520a3 100644 --- a/modules/artifactapi/main.tf +++ b/modules/artifactapi/main.tf @@ -122,6 +122,20 @@ resource "artifactapi_remote_github_deb" "this" { depends_on = [artifactapi_remote_generic.this] } +resource "artifactapi_remote_github_alpine" "this" { + for_each = var.remote_github_alpine + + name = each.key + base_url = each.value.base_url + description = each.value.description + releases_remote = each.value.releases_remote + mutable_ttl = each.value.mutable_ttl + patterns = each.value.patterns + stale_on_error = each.value.stale_on_error + + depends_on = [artifactapi_remote_generic.this] +} + resource "artifactapi_remote_npm" "this" { for_each = var.remote_npm @@ -222,6 +236,13 @@ resource "artifactapi_local_deb" "this" { description = each.value.description } +resource "artifactapi_local_alpine" "this" { + for_each = var.local_alpine + + name = each.key + description = each.value.description +} + resource "artifactapi_local_npm" "this" { for_each = var.local_npm diff --git a/modules/artifactapi/variables.tf b/modules/artifactapi/variables.tf index dfa3c70..1521648 100644 --- a/modules/artifactapi/variables.tf +++ b/modules/artifactapi/variables.tf @@ -127,6 +127,19 @@ variable "remote_github_deb" { default = {} } +variable "remote_github_alpine" { + description = "Map of GitHub-release-backed Alpine remote repositories" + type = map(object({ + base_url = string + description = optional(string, "") + releases_remote = string + mutable_ttl = optional(number, 3600) + patterns = optional(list(string), []) + stale_on_error = optional(bool, true) + })) + default = {} +} + variable "remote_npm" { description = "Map of npm remote repositories" type = map(object({ @@ -229,6 +242,14 @@ variable "local_deb" { default = {} } +variable "local_alpine" { + description = "Map of local Alpine repositories" + type = map(object({ + description = optional(string, "") + })) + default = {} +} + variable "local_npm" { description = "Map of local npm registries" type = map(object({