forked from chainguard-images/images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
51 lines (39 loc) · 1.14 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
42
43
44
45
46
47
48
49
50
51
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
}
}
variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}
module "latest-config" { source = "./config" }
module "latest" {
source = "../../tflib/publisher"
name = basename(path.module)
target_repository = var.target_repository
config = module.latest-config.config
}
module "dev" { source = "../../tflib/dev-subvariant" }
module "latest-dev" {
source = "../../tflib/publisher"
name = basename(path.module)
target_repository = var.target_repository
# Make the dev variant an explicit extension of the
# locked original.
config = jsonencode(module.latest.config)
extra_packages = module.dev.extra_packages
}
module "test-latest" {
source = "./tests"
digest = module.latest.image_ref
}
resource "oci_tag" "latest" {
depends_on = [module.test-latest]
digest_ref = module.latest.image_ref
tag = "latest"
}
resource "oci_tag" "latest-dev" {
depends_on = [module.test-latest]
digest_ref = module.latest-dev.image_ref
tag = "latest-dev"
}