2022-04-14 13:35:10 +00:00
|
|
|
OVERLAY := $(shell pwd)/overlay
|
|
|
|
STEP := publish
|
|
|
|
|
2024-07-15 12:52:22 +00:00
|
|
|
ifneq ($(ONLY),)
|
|
|
|
FONLY := --only $(ONLY)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(SKIP),)
|
|
|
|
FSKIP := --skip $(SKIP)
|
|
|
|
endif
|
|
|
|
|
2022-04-14 13:35:10 +00:00
|
|
|
all: build
|
|
|
|
|
|
|
|
build:
|
2024-07-15 12:52:22 +00:00
|
|
|
cd alpine-cloud-images && ./build $(STEP) --clean --pad-uefi-bin-arch '' --revise $(FONLY) $(FSKIP) --custom $(OVERLAY)/zdt --vars $(OVERLAY)/zdt/zdt.hcl
|
2022-04-14 13:35:10 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf alpine-cloud-images/work
|
2024-07-15 12:52:22 +00:00
|
|
|
rm -rf ~/tmp/alpine-cloud-images
|
2022-04-14 15:25:41 +00:00
|
|
|
|
|
|
|
# Adds all tracked encrypted files to .gitignore as safety net
|
|
|
|
age-add-gitignore:
|
2022-04-17 16:30:48 +00:00
|
|
|
@touch .gitignore; for f in $$(yq eval .paths[] .age.yml); do grep -qxF $$f .gitignore || echo $$f >> .gitignore; done
|
2022-04-14 15:25:41 +00:00
|
|
|
|
2022-04-19 08:49:26 +00:00
|
|
|
# Decrypts all secrets and deletes encrypted .age
|
2022-04-14 15:25:41 +00:00
|
|
|
age-unseal:
|
2022-04-17 16:30:48 +00:00
|
|
|
@for f in $$(yq eval .paths[] .age.yml); do \
|
|
|
|
age --decrypt -i ~/.ssh/git.age -o $$f $$f.age && rm $$f.age; \
|
|
|
|
done
|
2022-04-14 15:25:41 +00:00
|
|
|
|
2022-04-19 08:49:26 +00:00
|
|
|
# Compares all unencrypted files against last encrypted versions
|
2022-04-17 16:30:48 +00:00
|
|
|
# If there are no diffs, just restore the .age file from the index and delete the unaltered local unencrypted file
|
2022-04-19 08:49:26 +00:00
|
|
|
# otherwise re-encrypt and remove clear text
|
2022-04-14 15:25:41 +00:00
|
|
|
age-seal:
|
2022-04-17 16:30:48 +00:00
|
|
|
@keys=$$(yq eval .keys[] .age.yml | sed -e 's/^/-r /' ); \
|
|
|
|
for f in $$(yq eval .paths[] .age.yml); do \
|
2022-04-14 19:18:28 +00:00
|
|
|
[ -f $$f ] || continue; \
|
2022-04-19 08:49:26 +00:00
|
|
|
git restore $${f}.age 2>/dev/null && \
|
|
|
|
age --decrypt -i ~/.ssh/git.age $$f.age | diff -q - $$f 2>/dev/null 1>&2 && \
|
2022-04-17 16:30:48 +00:00
|
|
|
rm -f $$f || ( rm -f $$f.age; age --encrypt $$keys -o $$f.age $$f && rm -f $$f; ); done
|
2022-05-23 14:12:09 +00:00
|
|
|
|
|
|
|
# Just a reference how it could work, requires root though
|
|
|
|
scan-image:
|
2024-04-08 13:01:20 +00:00
|
|
|
doas ./scan_image.sh alpine-cloud-images/work/images/aws/*/image.qcow2
|
2022-11-04 14:10:49 +00:00
|
|
|
|
|
|
|
pull-upstream: ## pull latest shared alpine-cloud-images
|
|
|
|
git stash && git subtree pull --prefix alpine-cloud-images git@gitlab.alpinelinux.org:alpine/cloud/alpine-cloud-images.git main --squash && git stash pop
|