|
| 1 | +variable "TESTGEN_LABELS" {} |
| 2 | +variable "TESTGEN_BASE_LABEL" {} |
1 | 3 | variable "TESTGEN_VERSION" {} |
2 | | -variable "PUBLIC_RELEASE" { |
3 | | - default = false |
4 | | -} |
5 | 4 |
|
6 | | -function "docker_repo" { |
7 | | - params = [] |
8 | | - result = PUBLIC_RELEASE ? "datakitchen/dataops-testgen" : "datakitchen/dataops-testgen-qa" |
| 5 | +target "testgen-release" { |
| 6 | + args = { |
| 7 | + TESTGEN_VERSION = "${TESTGEN_VERSION}" |
| 8 | + TESTGEN_BASE_LABEL = "${TESTGEN_BASE_LABEL}" |
| 9 | + } |
| 10 | + context = "." |
| 11 | + dockerfile = "deploy/testgen.dockerfile" |
| 12 | + platforms = ["linux/amd64", "linux/arm64"] |
| 13 | + tags = formatlist("datakitchen/dataops-testgen:%s", split(" ", TESTGEN_LABELS)) |
9 | 14 | } |
10 | 15 |
|
11 | | -target "testgen" { |
| 16 | +target "testgen-qa" { |
12 | 17 | args = { |
13 | 18 | TESTGEN_VERSION = "${TESTGEN_VERSION}" |
| 19 | + TESTGEN_BASE_LABEL = "${TESTGEN_BASE_LABEL}" |
14 | 20 | } |
15 | 21 | context = "." |
16 | | - dockerfile = "Dockerfile" |
| 22 | + dockerfile = "deploy/testgen.dockerfile" |
| 23 | + platforms = ["linux/amd64", "linux/arm64"] |
| 24 | + tags = [format("datakitchen/dataops-testgen-qa:%s", index(split(" ", TESTGEN_LABELS), 0))] |
| 25 | +} |
| 26 | + |
| 27 | +target "testgen-base" { |
| 28 | + context = "." |
| 29 | + dockerfile = "deploy/testgen-base.dockerfile" |
17 | 30 | platforms = ["linux/amd64", "linux/arm64"] |
18 | | - tags = [ |
19 | | - "${docker_repo()}:v${TESTGEN_VERSION}", |
20 | | - PUBLIC_RELEASE ? "${docker_repo()}:v${index(regex("([0-9]+.[0-9]+).[0-9]+", TESTGEN_VERSION), 0)}": "", |
21 | | - PUBLIC_RELEASE ? "${docker_repo()}:v${index(regex("([0-9]+).[0-9]+.[0-9]+", TESTGEN_VERSION), 0)}": "" |
22 | | - ] |
| 31 | + tags = formatlist("datakitchen/dataops-testgen-base:%s", split(" ", TESTGEN_LABELS)) |
23 | 32 | } |
0 commit comments