-
Notifications
You must be signed in to change notification settings - Fork 147
/
main.tf
155 lines (129 loc) · 4.11 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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" {}
}
provider "imagetest" {
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 "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
}
provider "apko" {
alias = "alpine"
extra_repositories = ["https://dl-cdn.alpinelinux.org/alpine/edge/main"]
# These packages match chainguard-images/static
extra_packages = ["alpine-baselayout-data", "alpine-release", "ca-certificates-bundle"]
// Don't build for riscv64, 386, arm/v6
// Only build for: amd64, arm/v7, arm64, ppc64le, s390x
default_archs = length(var.archs) == 0 ? ["amd64", "arm/v7", "arm64", "ppc64le", "s390x"] : var.archs
}
provider "kubernetes" {
config_path = "~/.kube/config"
}
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
}
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"
providers = {
apko.alpine = apko.alpine
}
}
module "calico" {
source = "./images/calico"
target_repository = "${var.target_repository}/calico"
}
module "git" {
source = "./images/git"
target_repository = "${var.target_repository}/git"
providers = {
apko.alpine = apko.alpine
}
}
module "graalvm-native" {
source = "./images/graalvm-native"
target_repository = "${var.target_repository}/graalvm-native"
}
module "harbor" {
source = "./images/harbor"
target_repository = "${var.target_repository}/harbor"
}
module "k3s" {
source = "./images/k3s"
target_repository = "${var.target_repository}/k3s"
}
module "kubeflow" {
source = "./images/kubeflow"
target_repository = "${var.target_repository}/kubeflow"
}
module "kubeflow-katib" {
source = "./images/kubeflow-katib"
target_repository = "${var.target_repository}/kubeflow-katib"
}
module "maven" {
source = "./images/maven"
target_repository = "${var.target_repository}/maven"
}
module "powershell" {
source = "./images/powershell"
target_repository = "${var.target_repository}/powershell"
}
module "prometheus" {
source = "./images/prometheus"
target_repository = "${var.target_repository}/prometheus"
}
module "static" {
source = "./images/static"
target_repository = "${var.target_repository}/static"
providers = {
apko.alpine = apko.alpine
}
}
module "terraform" {
source = "./images/terraform"
target_repository = "${var.target_repository}/terraform"
}