2021-10-20 19:25:37 +00:00
|
|
|
export REPO_DIR:=$(CURDIR)/repo
|
2019-09-29 23:20:25 +00:00
|
|
|
export REPOKEY:=D0391BF9
|
2021-10-20 19:25:37 +00:00
|
|
|
export RETAIN:=1
|
|
|
|
export DATABASE:=$(shell find $(REPO_DIR) -maxdepth 1 -mindepth 1 -name '*.db.tar.xz' -or -name '*.db.tar.zst')
|
2019-09-29 23:20:25 +00:00
|
|
|
|
|
|
|
|
2021-09-23 06:47:24 +00:00
|
|
|
maintanance: do_updates do_cleanup list_packages upload
|
2019-09-29 23:26:01 +00:00
|
|
|
|
|
|
|
do_updates: aur_update
|
|
|
|
do_updates: repo_update
|
|
|
|
|
|
|
|
do_cleanup: cleanup_repo
|
|
|
|
do_cleanup: cleanup_orphan_signatures
|
|
|
|
do_cleanup: sign_database
|
2019-09-29 23:20:25 +00:00
|
|
|
|
|
|
|
download:
|
|
|
|
vault2env --key=secret/aws/private -- aws s3 sync \
|
|
|
|
--delete \
|
|
|
|
--exclude '*.old*' \
|
|
|
|
--exclude '.git/*' \
|
|
|
|
--acl=public-read \
|
2021-10-20 19:25:37 +00:00
|
|
|
s3://arch-luzifer-io/repo/x86_64/ $(REPO_DIR)/
|
2019-09-29 23:20:25 +00:00
|
|
|
|
2020-01-05 22:26:10 +00:00
|
|
|
upload: cleanup_files check_archive_mix
|
2019-09-29 23:20:25 +00:00
|
|
|
vault2env --key=secret/aws/private -- aws s3 sync \
|
|
|
|
--delete \
|
|
|
|
--exclude '*.old*' \
|
|
|
|
--exclude '.git/*' \
|
|
|
|
--acl=public-read \
|
2021-10-20 19:25:37 +00:00
|
|
|
$(REPO_DIR)/ s3://arch-luzifer-io/repo/x86_64/
|
2019-09-29 23:20:25 +00:00
|
|
|
|
|
|
|
# Maintenance targets
|
|
|
|
|
|
|
|
aur_update: check_tools check_database
|
|
|
|
bash -euo pipefail -c 'for pkg in $$(script_level=1 ./scripts/check_aur_updates.sh); do script_level=1 ./scripts/update-aur.sh $${pkg}; done'
|
|
|
|
|
2021-10-20 19:25:37 +00:00
|
|
|
check_aur_update: check_database
|
2019-10-06 22:09:33 +00:00
|
|
|
bash ./scripts/check_aur_updates.sh
|
|
|
|
|
2019-09-29 23:20:25 +00:00
|
|
|
check_database:
|
|
|
|
test -n '$(DATABASE)'
|
|
|
|
|
|
|
|
check_tools:
|
|
|
|
@which aws
|
2021-09-23 06:47:24 +00:00
|
|
|
@which column
|
2019-09-29 23:20:25 +00:00
|
|
|
@which curl
|
|
|
|
@which docker
|
|
|
|
@which jq
|
|
|
|
@which repo-add
|
|
|
|
@which vault
|
|
|
|
@which vault2env
|
|
|
|
|
|
|
|
cleanup_files:
|
2021-10-20 19:25:37 +00:00
|
|
|
rm -f *.old*
|
2019-09-29 23:20:25 +00:00
|
|
|
|
2021-10-20 19:25:37 +00:00
|
|
|
cleanup_orphan_signatures:
|
|
|
|
bash -euo pipefail -c 'for i in $(REPO_DIR)/*.sig; do [[ -f $${i//.sig} ]] || rm $${i}; done'
|
2019-09-29 23:20:25 +00:00
|
|
|
|
2021-10-20 19:25:37 +00:00
|
|
|
cleanup_repo: check_tools
|
|
|
|
bash ./scripts/do_cleanup.sh
|
2019-09-29 23:20:25 +00:00
|
|
|
|
2021-09-23 06:47:24 +00:00
|
|
|
list_packages:
|
2021-10-20 19:25:37 +00:00
|
|
|
tar -tf $(DATABASE) | grep -v '/desc' | sed -E 's/(.*)-([^-]+-[0-9]+)\//\1\t\2/' | sort | column -t >$(REPO_DIR)/packages.txt
|
2021-09-23 06:47:24 +00:00
|
|
|
|
2021-10-20 19:25:37 +00:00
|
|
|
repo_update: check_tools load_ssh_key
|
2019-09-29 23:20:25 +00:00
|
|
|
bash -euo pipefail -c 'for repo in $$(grep -v "^#" repo-urls); do script_level=1 ./scripts/update-repo.sh $${repo}; done'
|
|
|
|
|
|
|
|
sign_database:
|
|
|
|
repo-add -s --key $(REPOKEY) $(DATABASE)
|
2020-01-05 22:26:10 +00:00
|
|
|
|
|
|
|
# Helpers
|
|
|
|
|
|
|
|
check_archive_mix:
|
|
|
|
bash ./scripts/has_archive_mix.sh
|
2021-09-23 06:47:24 +00:00
|
|
|
|
|
|
|
load_ssh_key:
|
|
|
|
vault-sshadd loki
|