Load images from ci build cache

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
This commit is contained in:
Ricardo Lopes 2024-05-17 16:59:52 +01:00
parent ec239c69a9
commit e425baf734
5 changed files with 15 additions and 7 deletions

View file

@ -193,12 +193,18 @@ jobs:
export TAGNGINX=$(cat images/nginx/TAG)
make BASE_IMAGE=registry.k8s.io/ingress-nginx/nginx:${TAGNGINX} clean-image build image image-chroot
make -C test/e2e-image image
cd images/custom-error-pages/rootfs && docker image build \
--build-arg=BASE_IMAGE=registry.k8s.io/ingress-nginx/nginx-1.25:${TAGNGINX} \
--build-arg GOLANG_VERSION=$(cat ../../../GOLANG_VERSION) \
--tag ingress-controller/custom-error-pages:1.0.0-dev . \
&& cd ../../..
echo "creating images cache..."
docker save \
nginx-ingress-controller:e2e \
ingress-controller/controller:1.0.0-dev \
ingress-controller/controller-chroot:1.0.0-dev \
ingress-controller/custom-error-pages:1.0.0-dev \
| gzip > docker.tar.gz
- name: cache

View file

@ -43,6 +43,8 @@ jobs:
SKIP_CLUSTER_CREATION: true
SKIP_INGRESS_IMAGE_CREATION: true
SKIP_E2E_IMAGE_CREATION: true
SKIP_CUSTOMERRORPAGES_IMAGE_CREATION: true
ENABLE_VALIDATIONS: ${{ inputs.variation == 'VALIDATIONS' }}
IS_CHROOT: ${{ inputs.variation == 'CHROOT' }}
run: |
kind get kubeconfig > $HOME/.kube/kind-config-kind

View file

@ -41,9 +41,9 @@ EXTRAARGS ?= $(shell cat $(NAME)/EXTRAARGS)
export DOCKER_CLI_EXPERIMENTAL=enabled
# build with buildx
PLATFORMS?=linux/amd64,linux/arm,linux/arm64
OUTPUT=
PROGRESS=plain
BUILDX_PLATFORMS ?= linux/amd64,linux/arm,linux/arm64,linux/s390x
OUTPUT ?=
PROGRESS = plain
precheck:
@ -58,7 +58,7 @@ build: precheck ensure-buildx
--label=org.opencontainers.image.description="Ingress NGINX $(NAME) image" \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--build-arg GOLANG_VERSION=$(GO_VERSION) \
--platform=${PLATFORMS} $(OUTPUT) \
--platform=${BUILDX_PLATFORMS} $(OUTPUT) \
--progress=$(PROGRESS) \
--pull $(EXTRAARGS) \
-t $(IMAGE):$(TAG) $(NAME)/rootfs

View file

@ -1 +1 @@
localhost/custom-error-pages:e2e
ingress-controller/custom-error-pages:1.0.0-dev

View file

@ -107,7 +107,7 @@ fi
if [ "${SKIP_CUSTOMERRORPAGES_IMAGE_CREATION}" = "false" ]; then
echo "[dev-env] building custom-error-pages image"
REGISTRY=localhost NAME=custom-error-pages TAG=e2e make -C "${DIR}"/../../images build
make NAME=custom-error-pages -C "${DIR}"/../../images build
echo "[dev-env] .. done building custom-error-pages image"
fi
@ -118,6 +118,6 @@ echo "[dev-env] copying docker images to cluster..."
kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" nginx-ingress-controller:e2e
kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" "${REGISTRY}"/controller:"${TAG}"
kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" "localhost/custom-error-pages:e2e"
kind load docker-image --name="${KIND_CLUSTER_NAME}" --nodes="${KIND_WORKERS}" "${REGISTRY}"/custom-error-pages:"${TAG}"
echo "[dev-env] running e2e tests..."
make -C "${DIR}"/../../ e2e-test