taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit e2773476d3be4cf1877d2a47b965fe4cfcade680
parent 1796212571dcbeba0b75bdb68334d3b89b5b6440
Author: Devan Carpenter <devan@taler.net>
Date:   Tue, 26 Nov 2024 23:34:12 +0100

aptly: add garbage-collection script

Diffstat:
Aaptly/aptly-garbage-collect.sh | 14++++++++++++++
Maptly/aptly-publish.sh | 4----
Maptly/entr.sh | 2+-
3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/aptly/aptly-garbage-collect.sh b/aptly/aptly-garbage-collect.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -exou pipefail + +REPOROOT="${HOME}"/.aptly/public +DATESTAMP=$(date -Iseconds) + +# move any packages older than 30 days to the archive +mv $(find "${HOME}"/incoming/bookworm-taler-ci/ -mindepth 1 -mtime +30 | xargs echo) archive/ + +rm -rf "${HOME}"/garbagecollect +mv "${REPOROOT}"/pool "${HOME}"/garbagecollect || true +aptly repo drop --force taler-ci-snapshots || true +aptly db cleanup diff --git a/aptly/aptly-publish.sh b/aptly/aptly-publish.sh @@ -5,10 +5,6 @@ set -exou pipefail REPOROOT="${HOME}"/.aptly/public DATESTAMP=$(date -Iseconds) -rm -rf "${HOME}"/garbagecollect -mv "${REPOROOT}"/pool "${HOME}"/garbagecollect || true -aptly repo drop --force taler-ci-snapshots || true -aptly db cleanup aptly repo create -distribution=bookworm -component=main taler-ci-snapshots aptly repo add taler-ci-snapshots /home/aptbuilder/incoming/bookworm-taler-ci || true aptly snapshot create "taler-${DATESTAMP}" from repo taler-ci-snapshots diff --git a/aptly/entr.sh b/aptly/entr.sh @@ -2,5 +2,5 @@ set -xo while true ; do - echo "${HOME}/incoming/bookworm-taler-ci" | entr -n -d "${HOME}"/deployment/aptly/aptly-publish.sh ; sleep 1 || true + echo "${HOME}/incoming/bookworm-taler-ci" | entr -n -d "${HOME}/deployment/aptly/aptly-garbage-collect.sh && ${HOME}/deployment/aptly/aptly-publish.sh" ; sleep 1 || true done