alpine-overlay/Makefile

43 lines
1.6 KiB
Makefile

BUILDER := v3.16.2
RELEASE := v3.16
PKG := '*'
CF_DIST := E1YFUJXMCXT2RN
.PHONY: builder aports download upload packages
all: build
packages:
mkdir -p packages/kubezero/aarch64 packages/kubezero/x86_64
distfiles:
mkdir -p distfiles
aports:
[ -d aports/.git ] && { GIT_DIR=aports/.git cd aports; git pull; } \
|| git clone https://gitlab.alpinelinux.org/alpine/aports.git
# Mounts release into /work of the builder container to build all
build: packages distfiles
podman run -it --rm \
-v ${PWD}/distfiles:/var/cache/distfiles \
-v ${PWD}/packages:/home/alpine/packages \
-v ${PWD}/aports:/home/alpine/aports \
-v ${PWD}/kubezero:/home/alpine/kubezero \
-v ${HOME}/.gitconfig/:/home/alpine/.gitconfig:ro \
-v ${HOME}/.abuild/:/home/alpine/.abuild:ro \
public.ecr.aws/zero-downtime/alpine-builder:${BUILDER} $(PKG)
download:
aws s3 sync s3://zero-downtime-web/cdn/alpine/$(RELEASE)/kubezero/x86_64/ packages/work/x86_64/ --exclude APKINDEX.tar.gz
invalidate:
aws cloudfront create-invalidation --distribution $(CF_DIST) --paths "/alpine/*"
upload: invalidate
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