2022-10-06 18:03:30 +00:00
|
|
|
REGISTRY := public.ecr.aws/zero-downtime
|
|
|
|
IMAGE := alpine-builder
|
|
|
|
REGION := us-east-1
|
|
|
|
|
2024-09-10 22:17:15 +00:00
|
|
|
# Also tag builder images as latest major version
|
|
|
|
EXTRA_TAGS = $(shell echo $(GIT_TAG) | awk -F '.' '{ print $$1 "." $$2 }')
|
|
|
|
|
2022-10-06 18:03:30 +00:00
|
|
|
include .ci/podman.mk
|
|
|
|
|
2022-03-25 11:06:28 +00:00
|
|
|
PKG := '*'
|
2023-07-31 18:19:59 +00:00
|
|
|
CF_DIST := E11OFTOA3L8IVY
|
2022-09-06 11:30:04 +00:00
|
|
|
|
2024-09-10 22:17:15 +00:00
|
|
|
ALPINE_RELEASE = $(shell echo $(GIT_TAG) | sed -e 's/-.*$$//')
|
2024-10-25 16:22:11 +00:00
|
|
|
ALPINE_MAJOR := $(shell echo $(ALPINE_RELEASE) | sed -e 's/\.[0-9]$$//' -e's/v//')
|
2021-11-12 17:28:59 +00:00
|
|
|
|
2024-07-18 18:58:33 +00:00
|
|
|
.PHONY: aarch64-toolchain packages distfiles aports apk init_apk_repo
|
2022-10-06 18:03:30 +00:00
|
|
|
|
|
|
|
aarch64-toolchain:
|
2022-11-22 15:05:30 +00:00
|
|
|
podman run -it --rm \
|
2022-10-06 18:03:30 +00:00
|
|
|
-v ${PWD}/distfiles:/var/cache/distfiles \
|
|
|
|
-v ${PWD}/packages:/home/alpine/packages \
|
|
|
|
-v ${PWD}/aports:/home/alpine/aports \
|
|
|
|
-v ${HOME}/.gitconfig/:/home/alpine/.gitconfig:ro \
|
|
|
|
-v ${HOME}/.abuild/:/home/alpine/.abuild:ro \
|
|
|
|
$(REGISTRY)/$(IMAGE):$(TAG) aarch64-toolchain
|
2022-03-23 12:23:03 +00:00
|
|
|
|
2022-11-22 12:49:03 +00:00
|
|
|
packages:
|
2022-10-03 18:24:01 +00:00
|
|
|
mkdir -p packages/kubezero/aarch64 packages/kubezero/x86_64
|
2022-10-03 16:41:29 +00:00
|
|
|
|
2021-11-12 17:28:59 +00:00
|
|
|
distfiles:
|
|
|
|
mkdir -p distfiles
|
|
|
|
|
2022-11-22 12:49:03 +00:00
|
|
|
aports:
|
2024-10-25 16:22:11 +00:00
|
|
|
mkdir -p aports && cd aports
|
|
|
|
[ -d .git ] && git pull
|
|
|
|
[ -d .git ] || git clone https://gitlab.alpinelinux.org/alpine/aports.git .
|
2024-11-08 19:37:30 +00:00
|
|
|
git checkout $(ALPINE_MAJOR)-stable
|
2021-11-12 17:28:59 +00:00
|
|
|
|
2022-10-06 18:03:30 +00:00
|
|
|
apk: packages distfiles
|
2022-11-19 12:57:25 +00:00
|
|
|
podman run -it --rm --platform linux/$(_ARCH) \
|
2022-11-22 12:49:03 +00:00
|
|
|
--userns=keep-id:uid=1000,gid=1000 \
|
2021-11-12 17:28:59 +00:00
|
|
|
-v ${PWD}/distfiles:/var/cache/distfiles \
|
|
|
|
-v ${PWD}/packages:/home/alpine/packages \
|
2022-10-03 16:41:29 +00:00
|
|
|
-v ${PWD}/aports:/home/alpine/aports \
|
2022-10-03 18:24:01 +00:00
|
|
|
-v ${PWD}/kubezero:/home/alpine/kubezero \
|
2022-03-25 11:06:28 +00:00
|
|
|
-v ${HOME}/.gitconfig/:/home/alpine/.gitconfig:ro \
|
|
|
|
-v ${HOME}/.abuild/:/home/alpine/.abuild:ro \
|
2022-11-22 12:49:03 +00:00
|
|
|
--env DEBUG=$(DEBUG) \
|
2024-09-10 22:17:15 +00:00
|
|
|
$(REGISTRY)/$(IMAGE):$(ALPINE_RELEASE) $(PKG)
|
2022-10-06 18:03:30 +00:00
|
|
|
|
2022-05-13 21:16:13 +00:00
|
|
|
download:
|
2024-10-25 16:22:11 +00:00
|
|
|
aws s3 sync s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/x86_64/ packages/kubezero/x86_64/ --exclude APKINDEX.tar.gz
|
|
|
|
#aws s3 sync s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/aarch64/ packages/kubezero/aarch64/ --exclude APKINDEX.tar.gz
|
2022-05-13 21:16:13 +00:00
|
|
|
|
2022-10-06 18:03:30 +00:00
|
|
|
invalidate_cdn:
|
2022-09-06 11:30:04 +00:00
|
|
|
aws cloudfront create-invalidation --distribution $(CF_DIST) --paths "/alpine/*"
|
|
|
|
|
2022-10-06 18:03:30 +00:00
|
|
|
upload: invalidate_cdn
|
2024-10-25 16:22:11 +00:00
|
|
|
aws s3 sync --delete packages/kubezero/x86_64/ s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/x86_64/ --exclude APKINDEX.tar.gz
|
|
|
|
#aws s3 sync --delete packages/kubezero/aarch64/ s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/aarch64/ --exclude APKINDEX.tar.gz
|
|
|
|
aws s3 cp packages/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/v$(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/v$(ALPINE_MAJOR)/kubezero/aarch64/ --cache-control max-age=1
|
2024-07-18 18:58:33 +00:00
|
|
|
|
|
|
|
init_apk_repo:
|
2024-10-25 16:22:11 +00:00
|
|
|
aws s3 cp s3://zero-downtime-web-cdn/alpine/v3.19/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/x86_64/APKINDEX.tar.gz
|