1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 05:37:52 +03:00
Files
android_cast/deploy_alpine.sh
2026-06-20 21:25:10 +03:00

34 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
BRANCH=${BRANCH:-next}
CLEAN=${CLEAN:-yes}
DRY=${DRY:-no}
just_reload() {
sudo -E /etc/init.d/mariadb restart; sudo -E /etc/init.d/php-fpm81 restart; sudo -E /etc/init.d/nginx restart; sudo -E /etc/init.d/gitea restart;
sudo -E /etc/init.d/docker restart;
}
if [ "yes" = "${DRY}" ]; then
just_reload
exit $?
fi
git fetch --all --tags || exit $?
cp -f $0 /tmp/$0.backup || exit $?
git reset --hard || exit $?
cp -f ./examples/crash_reporter/backend/config/config.php.alpine /tmp/ 2>/dev/null ||:
cp -f ./examples/crash_reporter/backend/config/config.php.alpine ./examples/crash_reporter/backend/config/config.php 2>/dev/null||:
if [ "yes" = "${CLEAN}" ]; then
echo "auto cleanup - tidying working branch"
git clean -xdf
fi
echo "working branch: ${BRANCH}"
git checkout ${BRANCH} || exit $?
git status || exit $?
git pull --rebase || exit $?
git submodule update --init --recursive
if [ ! -f "./examples/crash_reporter/backend/config/config.php.alpine" ]; then
cp -f ./examples/crash_reporter/backend/config/config.php ./examples/crash_reporter/backend/config/config.php.alpine || exit $?
## patch config if needed
fi
cp -f ./examples/crash_reporter/backend/config/config.php.alpine ./examples/crash_reporter/backend/config/config.php || exit $?
REMOTE=alpine-be ./examples/app_hub/scripts/sync-landing-to-be.sh
just_reload