ci: minor tools cleanup

This commit is contained in:
Stefan Reimer 2024-09-10 22:17:15 +00:00
parent 194586a59a
commit 7b30e8dbd6

View File

@ -2,14 +2,16 @@ REGISTRY := public.ecr.aws/zero-downtime
IMAGE := alpine-builder
REGION := us-east-1
# Also tag builder images as latest major version
EXTRA_TAGS = $(shell echo $(GIT_TAG) | awk -F '.' '{ print $$1 "." $$2 }')
include .ci/podman.mk
BUILDER := v3.20.1
PKG := '*'
CF_DIST := E11OFTOA3L8IVY
BUILDER_RELEASE = $(shell echo $(BUILDER) | sed -e 's/-.*$$//')
RELEASE := $(shell echo $(BUILDER_RELEASE) | sed -e 's/\.[0-9]$$//')
ALPINE_RELEASE = $(shell echo $(GIT_TAG) | sed -e 's/-.*$$//')
ALPINE_MAJOR := $(shell echo $(ALPINE_RELEASE) | sed -e 's/\.[0-9]$$//')
.PHONY: aarch64-toolchain packages distfiles aports apk init_apk_repo
@ -29,9 +31,9 @@ distfiles:
mkdir -p distfiles
aports:
[ -d aports/.git ] && { cd aports; git pull origin $(BUILDER_RELEASE); }
[ -d aports/.git ] && { cd aports; git pull origin $(ALPINE_RELEASE); }
[ -d aports/.git ] || { git clone https://gitlab.alpinelinux.org/alpine/aports.git && \
cd aports && git checkout $(BUILDER_RELEASE); }
cd aports && git checkout $(ALPINE_RELEASE); }
apk: packages distfiles
podman run -it --rm --platform linux/$(_ARCH) \
@ -43,20 +45,20 @@ apk: packages distfiles
-v ${HOME}/.gitconfig/:/home/alpine/.gitconfig:ro \
-v ${HOME}/.abuild/:/home/alpine/.abuild:ro \
--env DEBUG=$(DEBUG) \
$(REGISTRY)/$(IMAGE):$(BUILDER) $(PKG)
$(REGISTRY)/$(IMAGE):$(ALPINE_RELEASE) $(PKG)
download:
aws s3 sync s3://zero-downtime-web-cdn/alpine/$(RELEASE)/kubezero/x86_64/ packages/kubezero/x86_64/ --exclude APKINDEX.tar.gz
#aws s3 sync s3://zero-downtime-web-cdn/alpine/$(RELEASE)/kubezero/aarch64/ packages/kubezero/aarch64/ --exclude APKINDEX.tar.gz
aws s3 sync s3://zero-downtime-web-cdn/alpine/$(ALPINE_MAJOR)/kubezero/x86_64/ packages/kubezero/x86_64/ --exclude APKINDEX.tar.gz
#aws s3 sync s3://zero-downtime-web-cdn/alpine/$(ALPINE_MAJOR)/kubezero/aarch64/ packages/kubezero/aarch64/ --exclude APKINDEX.tar.gz
invalidate_cdn:
aws cloudfront create-invalidation --distribution $(CF_DIST) --paths "/alpine/*"
upload: invalidate_cdn
aws s3 sync --delete packages/kubezero/x86_64/ s3://zero-downtime-web-cdn/alpine/$(RELEASE)/kubezero/x86_64/ --exclude APKINDEX.tar.gz
#aws s3 sync --delete packages/kubezero/aarch64/ s3://zero-downtime-web-cdn/alpine/$(RELEASE)/kubezero/aarch64/ --exclude APKINDEX.tar.gz
aws s3 cp packages/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/$(RELEASE)/kubezero/x86_64/ --cache-control max-age=1
#aws s3 cp packages/kubezero/aarch64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/$(RELEASE)/kubezero/aarch64/ --cache-control max-age=1
aws s3 sync --delete packages/kubezero/x86_64/ s3://zero-downtime-web-cdn/alpine/$(ALPINE_MAJOR)/kubezero/x86_64/ --exclude APKINDEX.tar.gz
#aws s3 sync --delete packages/kubezero/aarch64/ s3://zero-downtime-web-cdn/alpine/$(ALPINE_MAJOR)/kubezero/aarch64/ --exclude APKINDEX.tar.gz
aws s3 cp packages/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/$(ALPINE_MAJOR)/kubezero/x86_64/ --cache-control max-age=1
#aws s3 cp packages/kubezero/aarch64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/$(ALPINE_MAJOR)/kubezero/aarch64/ --cache-control max-age=1
init_apk_repo:
aws s3 cp s3://zero-downtime-web-cdn/alpine/v3.19/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/$(RELEASE)/kubezero/x86_64/APKINDEX.tar.gz
aws s3 cp s3://zero-downtime-web-cdn/alpine/v3.19/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/$(ALPINE_MAJOR)/kubezero/x86_64/APKINDEX.tar.gz