ci: minor tools cleanup
This commit is contained in:
parent
194586a59a
commit
7b30e8dbd6
28
Makefile
28
Makefile
@ -2,14 +2,16 @@ REGISTRY := public.ecr.aws/zero-downtime
|
|||||||
IMAGE := alpine-builder
|
IMAGE := alpine-builder
|
||||||
REGION := us-east-1
|
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
|
include .ci/podman.mk
|
||||||
|
|
||||||
BUILDER := v3.20.1
|
|
||||||
PKG := '*'
|
PKG := '*'
|
||||||
CF_DIST := E11OFTOA3L8IVY
|
CF_DIST := E11OFTOA3L8IVY
|
||||||
|
|
||||||
BUILDER_RELEASE = $(shell echo $(BUILDER) | sed -e 's/-.*$$//')
|
ALPINE_RELEASE = $(shell echo $(GIT_TAG) | sed -e 's/-.*$$//')
|
||||||
RELEASE := $(shell echo $(BUILDER_RELEASE) | sed -e 's/\.[0-9]$$//')
|
ALPINE_MAJOR := $(shell echo $(ALPINE_RELEASE) | sed -e 's/\.[0-9]$$//')
|
||||||
|
|
||||||
.PHONY: aarch64-toolchain packages distfiles aports apk init_apk_repo
|
.PHONY: aarch64-toolchain packages distfiles aports apk init_apk_repo
|
||||||
|
|
||||||
@ -29,9 +31,9 @@ distfiles:
|
|||||||
mkdir -p distfiles
|
mkdir -p distfiles
|
||||||
|
|
||||||
aports:
|
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 && \
|
[ -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
|
apk: packages distfiles
|
||||||
podman run -it --rm --platform linux/$(_ARCH) \
|
podman run -it --rm --platform linux/$(_ARCH) \
|
||||||
@ -43,20 +45,20 @@ apk: packages distfiles
|
|||||||
-v ${HOME}/.gitconfig/:/home/alpine/.gitconfig:ro \
|
-v ${HOME}/.gitconfig/:/home/alpine/.gitconfig:ro \
|
||||||
-v ${HOME}/.abuild/:/home/alpine/.abuild:ro \
|
-v ${HOME}/.abuild/:/home/alpine/.abuild:ro \
|
||||||
--env DEBUG=$(DEBUG) \
|
--env DEBUG=$(DEBUG) \
|
||||||
$(REGISTRY)/$(IMAGE):$(BUILDER) $(PKG)
|
$(REGISTRY)/$(IMAGE):$(ALPINE_RELEASE) $(PKG)
|
||||||
|
|
||||||
download:
|
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/$(ALPINE_MAJOR)/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/aarch64/ packages/kubezero/aarch64/ --exclude APKINDEX.tar.gz
|
||||||
|
|
||||||
invalidate_cdn:
|
invalidate_cdn:
|
||||||
aws cloudfront create-invalidation --distribution $(CF_DIST) --paths "/alpine/*"
|
aws cloudfront create-invalidation --distribution $(CF_DIST) --paths "/alpine/*"
|
||||||
|
|
||||||
upload: invalidate_cdn
|
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/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/$(RELEASE)/kubezero/aarch64/ --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/$(RELEASE)/kubezero/x86_64/ --cache-control max-age=1
|
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/$(RELEASE)/kubezero/aarch64/ --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:
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user