This repository has been archived on 2024-01-08. You can view files and clone it, but cannot push or open issues/pull-requests.
2023-04-17 21:47:53 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
REPO="https://git.c3re.de/c3re/test-website.git"
|
|
|
|
|
|
|
|
refresh() {
|
|
|
|
cd
|
|
|
|
|
2023-04-17 22:34:48 +02:00
|
|
|
test -d site/ || {
|
|
|
|
rm -rf site
|
2023-04-17 21:47:53 +02:00
|
|
|
git clone --recursive "$REPO" site
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cd site
|
|
|
|
git pull
|
|
|
|
for branch in $(git branch -a | grep remotes | grep -v HEAD); do
|
|
|
|
branch=${branch#remotes/origin/}
|
|
|
|
git checkout "$branch"
|
|
|
|
git pull
|
|
|
|
git reset --hard
|
|
|
|
hugo
|
|
|
|
mkdir -p /var/www/html/"$branch"
|
|
|
|
rsync -avz --delete public/* /var/www/html/"$branch"/
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
sleep 60 &
|
|
|
|
|
|
|
|
refresh
|
|
|
|
|
|
|
|
wait
|
|
|
|
|
|
|
|
done
|