Compare commits

4 Commits
test ... main

Author SHA1 Message Date
ad497531ff Revert "Print summary"
All checks were successful
continuous-integration/drone Build is passing
This reverts commit fcc58686cf.
2023-10-03 00:36:44 +02:00
fcc58686cf Print summary
Some checks failed
continuous-integration/drone Build is failing
2023-09-10 04:35:15 +02:00
1c00484fc2 Move Repo update to the end
All checks were successful
continuous-integration/drone Build is passing
2023-08-21 19:51:04 +02:00
234f8ad9a6 fix ninja 2023-08-21 19:51:04 +02:00

View File

@ -18,20 +18,6 @@ mcli alias set s3 https://s3.tobiasmanske.de "${REPO_ACCESS_KEY}" "${REPO_SECRET
# LOCK # LOCK
LOCK="" LOCK=""
while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
if [[ ${DEBUG:-} == "true" ]]; then
echo "Debug mode, not waiting for lock"
break
fi
LOCK=$(mcli cat s3/repo/LOCK)
if [[ "${LOCK}" == "FREE" ]]; then
echo $PIPELINE_ID | mcli pipe s3/repo/LOCK
LOCK=$(mcli cat s3/repo/LOCK)
continue
fi
echo "Waiting for lock with id $PIPELINE_ID..."
sleep $((RANDOM % 10))
done
unlock() { unlock() {
if [[ "${LOCK}" == "${PIPELINE_ID}" ]]; then if [[ "${LOCK}" == "${PIPELINE_ID}" ]]; then
@ -40,16 +26,36 @@ unlock() {
} }
trap unlock EXIT INT TERM lock () {
while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
if [[ ${DEBUG:-} == "true" ]]; then
echo "Debug mode, not waiting for lock"
break
fi
LOCK=$(mcli cat s3/repo/LOCK)
if [[ "${LOCK}" == "FREE" ]]; then
echo $PIPELINE_ID | mcli pipe s3/repo/LOCK
LOCK=$(mcli cat s3/repo/LOCK)
continue
fi
echo "Waiting for lock with id $PIPELINE_ID..."
sleep $((RANDOM % 10))
done
trap unlock EXIT INT TERM
}
echo "Pulling Repository" pullrepo () {
( 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.sig" /repo mcli cp "s3/repo/x86_64/${AUR_REPO_NAME}.db.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}.db.tar.xz.sig" /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" /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"
@ -125,9 +131,12 @@ fi
# aur build -S --noconfirm -a queue --no-sync --margs -s # aur build -S --noconfirm -a queue --no-sync --margs -s
export AUR_SYNC_USE_NINJA=1 export AUR_SYNC_USE_NINJA=1
cat graph | aur sync--ninja --keep-going=0 -S -- makepkg -sir | ninja -f /dev/stdin cat graph | aur sync--ninja -S -- aur build -S --noconfirm --no-sync --margs -s | tee -a /dev/stderr | ninja -k 0 -f /dev/stdin
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