Move Repo update to the end
This commit is contained in:
parent
16b25be5bb
commit
3f6071f16e
@ -18,7 +18,16 @@ mcli alias set s3 https://s3.tobiasmanske.de "${REPO_ACCESS_KEY}" "${REPO_SECRET
|
|||||||
# LOCK
|
# LOCK
|
||||||
LOCK=""
|
LOCK=""
|
||||||
|
|
||||||
while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
|
|
||||||
|
unlock() {
|
||||||
|
if [[ "${LOCK}" == "${PIPELINE_ID}" ]]; then
|
||||||
|
echo "FREE" | mcli pipe s3/repo/LOCK
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
lock () {
|
||||||
|
while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
|
||||||
if [[ ${DEBUG:-} == "true" ]]; then
|
if [[ ${DEBUG:-} == "true" ]]; then
|
||||||
echo "Debug mode, not waiting for lock"
|
echo "Debug mode, not waiting for lock"
|
||||||
break
|
break
|
||||||
@ -31,25 +40,22 @@ while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
|
|||||||
fi
|
fi
|
||||||
echo "Waiting for lock with id $PIPELINE_ID..."
|
echo "Waiting for lock with id $PIPELINE_ID..."
|
||||||
sleep $((RANDOM % 10))
|
sleep $((RANDOM % 10))
|
||||||
done
|
done
|
||||||
|
trap unlock EXIT INT TERM
|
||||||
unlock() {
|
|
||||||
if [[ "${LOCK}" == "${PIPELINE_ID}" ]]; then
|
|
||||||
echo "FREE" | mcli pipe s3/repo/LOCK
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trap unlock EXIT INT TERM
|
pullrepo () {
|
||||||
|
echo "Pulling Repository"
|
||||||
echo "Pulling Repository"
|
(
|
||||||
(
|
|
||||||
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.db.tar.xz" /repo
|
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.db.tar.xz" /repo
|
||||||
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.db.tar.xz.sig" /repo
|
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.db.tar.xz.sig" /repo
|
||||||
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.files.tar.xz" /repo
|
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.files.tar.xz" /repo
|
||||||
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.files.tar.xz.sig" /repo
|
mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.files.tar.xz.sig" /repo
|
||||||
|
|
||||||
) &>/dev/null
|
) &>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
pullrepo
|
||||||
|
|
||||||
if ! (aur repo >/dev/null 2>&1); then
|
if ! (aur repo >/dev/null 2>&1); then
|
||||||
printf "Aur repo not initialized, initializing /repo...\n"
|
printf "Aur repo not initialized, initializing /repo...\n"
|
||||||
@ -129,5 +135,8 @@ cat graph | aur sync--ninja -S -- aur build -S --noconfirm --no-sync --margs -s
|
|||||||
echo "##################################"
|
echo "##################################"
|
||||||
ls -la /repo
|
ls -la /repo
|
||||||
|
|
||||||
## Upload to repo
|
pullrepo
|
||||||
|
lock
|
||||||
|
repo-add -k C3FE87CFB8F8D503AE03EC1C033E7F3DC71FE89E --sign "/repo/${AUR_REPO_NAME}.db.tar.xz" /repo/*.pkg.tar.zst
|
||||||
mcli mirror --overwrite /repo s3/repo/x86_64
|
mcli mirror --overwrite /repo s3/repo/x86_64
|
||||||
|
unlock
|
||||||
|
Loading…
Reference in New Issue
Block a user