#!/bin/sh BRANCH=${BRANCH:-next} CLEAN=${CLEAN:-yes} 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/ || exit $? cp -f ./examples/crash_reporter/backend/config/config.php.alpine ./examples/crash_reporter/backend/config/config.php || exit $? 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 $? if [ -f ./examples/crash_reporter/backend/config/config.php.alpine ]; then cp -f ./examples/crash_reporter/backend/config/config.php.alpine ./examples/crash_reporter/backend/config/config.php ||: fi 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;