1#!/bin/sh
2LOCAL_REPO=${HOME}/flatpak-repos/peek
3REMOTE_REPO=s3://flatpak.uploadedlobster.com
4REGION=eu-central-1
5
6flatpak build-update-repo \
7  --generate-static-deltas \
8  --gpg-sign=B539AD7A5763EE9C1C2E4DE24C14923F47BF1A02 \
9  --prune --prune-depth=20 \
10  ${LOCAL_REPO}
11
12# First sync all but the summary
13aws s3 sync --region="${REGION}" \
14  --acl public-read \
15  --exclude="summary" --exclude="summary.sig" \
16  "${LOCAL_REPO}" "${REMOTE_REPO}"
17
18# Sync the summary
19aws s3 sync --region="${REGION}" \
20  --acl public-read \
21  --exclude="*" --include="summary" --include="summary.sig" \
22  "${LOCAL_REPO}" "${REMOTE_REPO}"
23
24# As a last pass also sync deleted files
25aws s3 sync --region="${REGION}" \
26  --acl public-read \
27  --delete \
28  "${LOCAL_REPO}" "${REMOTE_REPO}"
29