Skip to content

Commit

Permalink
automated commit
Browse files Browse the repository at this point in the history
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Aug 23, 2024
1 parent ca2dcbb commit 9537f89
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
8 changes: 4 additions & 4 deletions images/tomcat/generated.tf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 25 additions & 16 deletions images/tomcat/main.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
}
module "versions" {
package = "tomcat"
source = "../../tflib/versions"
}

variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}

module "config" { source = "./config" }
locals {
latest_jdk = "21"
}

module "latest" {
source = "../../tflib/publisher"
module "config" {
extra_packages = ["tomcat-${each.value.version}-openjdk-${local.latest_jdk}"]
for_each = module.versions.versions
source = "./config"
}

module "versioned" {
build-dev = true
config = module.config[each.key].config
for_each = module.versions.versions
main_package = "${each.key}-openjdk-${local.latest_jdk}"
name = basename(path.module)
source = "../../tflib/publisher"
target_repository = var.target_repository
config = module.config.config
build-dev = true
main_package = "tomcat-10.1-openjdk-17"
update-repo = each.value.is_latest
}

module "test-latest" {
module "test" {
digest = module.versioned[local.last].image_ref
source = "./tests"
digest = module.latest.image_ref
}

resource "oci_tag" "latest" {
depends_on = [module.test-latest]
digest_ref = module.latest.image_ref
tag = "latest"
module "tagger" {
depends_on = [module.test]
source = "../../tflib/tagger"
tags = merge([for v in module.versioned : v.latest_tag_map]...)
}

0 comments on commit 9537f89

Please sign in to comment.