mapcomplete/deploy.sh

40 lines
1.3 KiB
Bash
Raw Normal View History

2020-07-16 17:29:52 +02:00
#! /bin/bash
2020-09-18 11:55:36 +02:00
mkdir -p assets/generated
2020-09-20 19:11:32 +02:00
ts-node createLayouts.ts || { echo 'Creating layouts failed' ; exit 1; }
find -name '*.png' | parallel optipng '{}'
2020-09-20 19:11:32 +02:00
npm run build || { echo 'Npm build failed' ; exit 1; }
2020-08-22 03:15:42 +02:00
2020-09-25 23:24:56 +02:00
rm -rf .cache
2020-09-20 19:11:32 +02:00
if [[ $1 == "groen" ]]
2020-09-05 01:40:43 +02:00
then
2020-09-20 19:11:32 +02:00
echo "DEPLOYING TO BUURTNATUUR!"
2020-09-18 11:55:36 +02:00
mv /home/pietervdvn/git/buurtnatuur.github.io/CNAME /home/pietervdvn/git/
mv /home/pietervdvn/git/buurtnatuur.github.io/.git /home/pietervdvn/git/
rm -rf /home/pietervdvn/git/buurtnatuur.github.io/*
cp -r dist/* /home/pietervdvn/git/buurtnatuur.github.io/
mv /home/pietervdvn/git/CNAME /home/pietervdvn/git/buurtnatuur.github.io/
mv /home/pietervdvn/git/.git /home/pietervdvn/git/buurtnatuur.github.io/
cd /home/pietervdvn/git/buurtnatuur.github.io/
2020-09-20 19:11:32 +02:00
elif [[ $1 == "production" ]]
2020-09-18 11:55:36 +02:00
then
2020-09-20 19:11:32 +02:00
echo "DEPLOYING TO MAPCOMPLETE"
2020-09-05 01:40:43 +02:00
rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/*
cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
cd /home/pietervdvn/git/pietervdvn.github.io/MapComplete/
else
echo "Testversion deploy"
rm -rf /home/pietervdvn/git/pietervdvn.github.io/Staging/*
cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/Staging/
cd /home/pietervdvn/git/pietervdvn.github.io/Staging/
fi
2020-09-18 11:55:36 +02:00
git add *
git commit -am "New mapcomplete version"
git push
2020-08-22 03:15:42 +02:00
cd -
2020-09-10 19:33:06 +02:00
./clean.sh
2020-09-18 11:55:36 +02:00
2020-09-19 13:42:25 +02:00
echo "DEPLOYED $1"