1
0
Fork 0
mirror of https://github.com/Luzifer/archrepo.git synced 2024-12-30 01:41:23 +00:00
archrepo/Makefile

66 lines
1.4 KiB
Makefile
Raw Normal View History

export REPO_DIR:=$(CURDIR)/repo
2019-09-29 23:20:25 +00:00
export REPOKEY:=D0391BF9
export RETAIN:=1
export DATABASE:=$(REPO_DIR)/luzifer.db.tar.zst
2019-09-29 23:20:25 +00:00
maintanance: do_updates do_cleanup list_packages upload
do_updates: repo_update
do_cleanup: cleanup_repo
do_cleanup: cleanup_orphan_signatures
do_cleanup: sign_database
do_cleanup: cleanup_files
do_cleanup: list_packages
2019-09-29 23:20:25 +00:00
download:
bash -ec "eval $$(vault2env --key secret/minio/archrepo --export) && s3sync --delete s3://archrepo/x86_64/ $(REPO_DIR)/"
2019-09-29 23:20:25 +00:00
upload: cleanup_files check_archive_mix
bash -ec "eval $$(vault2env --key secret/minio/archrepo --export) && s3sync --delete $(REPO_DIR)/ s3://archrepo/x86_64/"
2019-09-29 23:20:25 +00:00
# Maintenance targets
check_database:
test -n '$(DATABASE)'
check_tools:
@which aws
@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:
rm -f $(REPO_DIR)/*.old*
2019-09-29 23:20:25 +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
cleanup_repo: check_tools
bash ./scripts/do_cleanup.sh
2019-09-29 23:20:25 +00:00
clear_database:
rm -f $(REPO_DIR)/*.db* $(REPO_DIR)/*.files*
list_packages:
bash ./scripts/listing.sh >$(REPO_DIR)/packages.txt
repo_update: check_tools load_ssh_key
bash ./scripts/update-all.sh
2019-09-29 23:20:25 +00:00
sign_database:
repo-add -s --key $(REPOKEY) $(DATABASE)
# Helpers
check_archive_mix:
bash ./scripts/has_archive_mix.sh
load_ssh_key:
vault-sshadd loki