Minor tweaks to production, use git pull --rebase, only build 1 frontend

This commit is contained in:
wiz 2020-07-25 01:45:30 +09:00
parent 81d05e23b8
commit 7f7c6ef6f8
No known key found for this signature in database
GPG key ID: A394E332255A6173
3 changed files with 18 additions and 9 deletions

View file

@ -3,12 +3,19 @@ for site in mainnet liquid testnet bisq
do do
git clone https://github.com/mempool/mempool "${HOME}/${site}" git clone https://github.com/mempool/mempool "${HOME}/${site}"
mkdir -p "${HOME}/public_html/${site}/" mkdir -p "${HOME}/public_html/${site}/"
cd "${HOME}/${site}/backend/" cd "${HOME}/${site}/backend/"
cp "../production/mempool-config.${site}.json" "mempool-config.json" cp "../production/mempool-config.${site}.json" "mempool-config.json"
touch cache.json touch cache.json
npm install npm install
npm run build npm run build
if [ "${site}" = "mainnet" ]
then
cd "${HOME}/${site}/frontend/" cd "${HOME}/${site}/frontend/"
npm install npm install
npm run build npm run build
rsync -av ./dist/mempool/* "${HOME}/public_html/${site}/"
fi
done done

View file

@ -0,0 +1,2 @@
#!/usr/bin/env zsh
killall sh node

View file

@ -7,13 +7,13 @@ touch $HOME/lock
echo 'rebuilding mempool sites'|wall echo 'rebuilding mempool sites'|wall
cd "$HOME/mempool" cd "$HOME/mempool"
git pull origin master git pull --rebase origin master
cd "$HOME/" cd "$HOME/"
for site in mainnet liquid testnet bisq for site in mainnet liquid testnet bisq
do do
cd "$HOME/${site}" cd "$HOME/${site}"
git pull origin master git pull --rebase origin master
hash=$(git rev-parse HEAD) hash=$(git rev-parse HEAD)
if [ "${site}" = "mainnet" ] if [ "${site}" = "mainnet" ]