-
Notifications
You must be signed in to change notification settings - Fork 154
/
main.tf
108 lines (89 loc) · 2.84 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
terraform {
required_providers {
apko = { source = "chainguard-dev/apko" }
imagetest = { source = "chainguard-dev/imagetest" }
}
# We don't take advantage of terraform.tfstate, so we don't need to save state anywhere.
#
# The default "local" backend has pathological performance as state gets large, see:
# https://github.com/opentofu/opentofu/issues/578
#
# Consider removing this if that's ever fixed and/or if we want to use tfstate.
backend "inmem" {}
}
variable "tests_skip_all" {
type = bool
default = false
}
variable "tests_include_by_label" {
type = map(string)
default = {}
}
variable "tests_exclude_by_label" {
type = map(string)
default = {}
}
provider "imagetest" {
repo = "${var.target_repository}/imagetest"
test_execution = {
skip_all_tests = var.tests_skip_all
include_by_label = var.tests_include_by_label
exclude_by_label = var.tests_exclude_by_label
}
log = {
file = {
directory = "imagetest-logs"
}
}
}
variable "target_repository" {
type = string
description = "The root repo into which the images should be published (e.g., cgr.dev/chainguard). Individual images will be published within this root repo."
}
variable "test_repository" {
description = "The docker repo root to use for sourcing test images."
default = "cgr.dev/chainguard"
}
variable "extra_repositories" {
type = list(string)
default = []
description = "Extra repositories to look for when finding packages."
}
variable "extra_keyring" {
type = list(string)
default = []
description = "Extra keyrings to use when finding packages."
}
variable "extra_packages" {
type = list(string)
default = []
description = "Extra packages to install in all images."
}
variable "archs" {
type = list(string)
default = []
description = "The architectures to build for. If empty, defaults to x86_64 and aarch64."
}
provider "apko" {
extra_repositories = concat(["https://packages.wolfi.dev/os"], var.extra_repositories)
extra_keyring = concat(["https://packages.wolfi.dev/os/wolfi-signing.rsa.pub"], var.extra_keyring)
extra_packages = concat(["wolfi-baselayout"], var.extra_packages)
default_archs = length(var.archs) == 0 ? ["x86_64", "aarch64"] : var.archs
}
variable "newrelic_license_key" { default = "foo" } # set something valid to avoid targetted local runs
module "busybox" {
source = "./images/busybox"
target_repository = "${var.target_repository}/busybox"
}
module "git" {
source = "./images/git"
target_repository = "${var.target_repository}/git"
}
module "maven" {
source = "./images/maven"
target_repository = "${var.target_repository}/maven"
}
module "static" {
source = "./images/static"
target_repository = "${var.target_repository}/static"
}