From 0506a5404ea471935a013f5775fc8dd2cdde529e Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Wed, 1 Nov 2023 18:13:57 +1100 Subject: [PATCH] allow make to override UPSTREAMs --- Makefile | 2 +- docker-bake.hcl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b883ec78d3..cdb27eba5a 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ endif # Builds a docker image. Expects as arguments: name of the image, location of Dockerfile, path of # Docker Build Context -docker_build = PLATFORMS=$(PLATFORM_ARCH) IMAGE_REPO=$(CI_BUILD_TAG) TAG=latest LAGOON_VERSION=$(LAGOON_VERSION) docker buildx bake -f docker-bake.hcl $(1) --builder $(CI_BUILD_TAG) --load +docker_build = PLATFORMS=$(PLATFORM_ARCH) IMAGE_REPO=$(CI_BUILD_TAG) UPSTREAM_REPO=$(UPSTREAM_REPO) UPSTREAM_TAG=$(UPSTREAM_TAG) TAG=latest LAGOON_VERSION=$(LAGOON_VERSION) docker buildx bake -f docker-bake.hcl $(1) --builder $(CI_BUILD_TAG) --load docker_buildx_create = docker buildx create --name $(CI_BUILD_TAG) || echo -e '$(CI_BUILD_TAG) builder already present\n' diff --git a/docker-bake.hcl b/docker-bake.hcl index db1501c324..fc1a5d662c 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -11,6 +11,14 @@ variable "LAGOON_VERSION" { default = "development" } +variable "UPSTREAM_REPO" { + default = "uselagoon" +} + +variable "UPSTREAM_TAG" { + default = "latest" +} + variable "PLATFORMS" { // use PLATFORMS=linux/amd64,linux/arm64 to override default single architecture on the cli default = "linux/amd64" @@ -29,6 +37,8 @@ target "default"{ } args = { LAGOON_VERSION = "${LAGOON_VERSION}" + UPSTREAM_REPO = "${UPSTREAM_REPO}" + UPSTREAM_TAG = "${UPSTREAM_TAG}" } }