Skip to content

Commit 7830b92

Browse files
committed
RELEASE bake var to filter out unsupported distros
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 3f2c2b7 commit 7830b92

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

docker-bake.hcl

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
variable "DISTROS" {
16-
description = "List of supported distros. Don't forget to update _distro-* target if you add/remove a distro."
15+
variable "RELEASE" {
16+
description = "Set to true to enable release mode. In release mode, some distros are not built."
17+
default = false
18+
}
19+
20+
variable "ALL_DISTROS" {
21+
description = "List of all supported distros. Don't forget to update _distro-* target if you add/remove a distro."
1722
default = [
1823
"static",
1924

@@ -42,6 +47,18 @@ variable "DISTROS" {
4247
]
4348
}
4449

50+
variable "DISTROS" {
51+
description = "List of distros used by packages."
52+
default = RELEASE ? setsubtract(ALL_DISTROS, [
53+
"almalinux8",
54+
"almalinux9",
55+
"oraclelinux8",
56+
"oraclelinux9",
57+
"rockylinux8",
58+
"rockylinux9"
59+
]) : ALL_DISTROS
60+
}
61+
4562
variable "PKGS" {
4663
description = "List of packages to build from ./pkg directory. Don't forget to update _pkg-* target if you add/remove a package."
4764
default = [
@@ -459,6 +476,19 @@ function "distroSecrets" {
459476
result = length(regexall("^rhel", distro)) > 0 ? ["type=env,id=RH_USER,env=RH_USER", "type=env,id=RH_PASS,env=RH_PASS"] : []
460477
}
461478

479+
target "_deploy-distros" {
480+
args = {
481+
DISTROS = join(",", setsubtract(DISTROS, [
482+
"almalinux8",
483+
"almalinux9",
484+
"oraclelinux8",
485+
"oraclelinux9",
486+
"rockylinux8",
487+
"rockylinux9"
488+
]))
489+
}
490+
}
491+
462492
#
463493
# pkgs configurations
464494
#

0 commit comments

Comments
 (0)