-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmain.tf
41 lines (35 loc) · 1.05 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
terraform {
required_providers {
apko = {
source = "chainguard-dev/apko"
configuration_aliases = [apko.alpine]
}
oci = { source = "chainguard-dev/oci" }
}
}
variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}
module "latest" {
providers = { apko = apko.alpine }
source = "chainguard-dev/apko/publisher"
version = "0.0.17"
target_repository = var.target_repository
config = file("${path.module}/configs/latest.apko.yaml")
extra_packages = [] # The default pulls in wolfi-baselayout which cannot be used in alpine
}
module "test-latest" {
source = "./tests"
digest = module.latest.image_ref
}
module "version-tags" {
source = "../../tflib/version-tags"
package = "musl"
config = module.latest.config
}
resource "oci_tag" "version-tags" {
depends_on = [module.test-latest]
for_each = toset(concat(["latest"], module.version-tags.tag_list))
digest_ref = module.latest.image_ref
tag = each.key
}