Improve docker setup and update scripts

This commit is contained in:
2026-06-12 19:48:20 +02:00
parent ab79e7e543
commit c2c2e2d666
7 changed files with 175 additions and 30 deletions
+46 -17
View File
@@ -1,25 +1,54 @@
#! /bin/bash
if [ ! -d "/repo/.git" ]; then
if [ ! -d "/code/.git" ]; then
echo "Performing initial setup!"
mkdir /code
echo "Cloning repository..."
git clone --branch "$BRANCH" "$REPO_URL" "/repo"
git clone --branch "$BRANCH" "$REPO_URL" "/code"
echo "Decrypting secrets..."
cd /code
./scripts/decrypt.sh
echo "Done"
fi
while true; do
echo "Running repo update..."
echo "Running regular repo update..."
echo ""
cd "/repo" || exit
git fetch origin
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse origin/binaries)
cd "/code"
git fetch origin
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse "origin/$BRANCH")
if [ "$LOCAL" != "$REMOTE" ]; then
echo "Updating repo..."
git reset --hard origin/binaries
echo "Update complete."
else
echo "Nothing to do."
fi
NEED_FDROID_UPDATE=false
sleep 600 # check every 10 min
done
# Update repo
if [ "$LOCAL" != "$REMOTE" ]; then
NEED_FDROID_UPDATE=true
echo "Pulling repo..."
git pull "origin/$BRANCH"
echo "Pull complete"
echo "Decrypting secrets..."
./scripts/decrypt.sh
echo "Done"
else
echo "No changes in repo."
fi
# Update apks
echo "Updating apks..."
./scripts/update-apks.sh
if [ $? -eq 10 ]; then
NEED_FDROID_UPDATE=true
fi
# Run fdroid update if needed
if [ "$NEED_FDROID_UPDATE" = true ]; then
echo "Running fdroid update..."
fdroid update -c
fdroid update
echo "Done"
else
echo "No changes made so no fdroid update necessary."
echo "Done"
fi