update githook

This commit is contained in:
HF 2022-09-11 13:36:50 +02:00
parent 93e756cf15
commit fb529794df

View File

@ -30,6 +30,24 @@ npm_reinstall () {
npm install npm install
} }
copy () {
local TARGETDIR="${1}"
local REINSTALL="${2}"
cp -r dist/*.js "${TARGETDIR}/"
cp -r dist/workers "${TARGETDIR}/"
rm -rf "${TARGETDIR}/public/assets"
cp -r dist/public "${TARGETDIR}/"
cp -r dist/captchaFonts "${TARGETDIR}/"
cp -r dist/package.json "${TARGETDIR}/"
cp -r dist/assets.json "${TARGETDIR}/"
cp -r dist/styleassets.json "${TARGETDIR}/"
mkdir -p "${TARGETDIR}/log"
cd "${TARGETDIR}"
[ $REINSTALL -eq 0 ] && npm_reinstall
pm2 start ecosystem.yml
cd -
}
while read oldrev newrev refname while read oldrev newrev refname
do do
GIT_WORK_TREE="$BUILDDIR" GIT_DIR="${BUILDDIR}/.git" git fetch --all GIT_WORK_TREE="$BUILDDIR" GIT_DIR="${BUILDDIR}/.git" git fetch --all
@ -46,20 +64,10 @@ do
[ $DO_REINSTALL -eq 0 ] && npm_reinstall [ $DO_REINSTALL -eq 0 ] && npm_reinstall
npm run build npm run build
echo "---RESTARTING CANVAS---" echo "---RESTARTING CANVAS---"
cp -r dist/*.js "${PFOLDER}/"
cp -r dist/workers "${PFOLDER}/"
rm -rf "${PFOLDER}/public/assets"
cp -r dist/public "${PFOLDER}/"
cp -r dist/captchaFonts "${PFOLDER}/"
cp -r dist/package.json "${PFOLDER}/"
cp -r dist/assets.json "${PFOLDER}/"
cp -r dist/styleassets.json "${PFOLDER}/"
mkdir -p "${PFOLDER}/log"
cd "$PFOLDER"
pm2 stop ppfun-server pm2 stop ppfun-server
pm2 stop ppfun-backups pm2 stop ppfun-backups
[ $DO_REINSTALL -eq 0 ] && npm_reinstall copy "${PFOLDER}" "${DO_REINSTALL}"
pm2 start ecosystem.yml cd "$PFOLDER"
pm2 start ecosystem-backup.yml pm2 start ecosystem-backup.yml
else else
echo "---UPDATING REPO ON DEV SERVER---" echo "---UPDATING REPO ON DEV SERVER---"
@ -73,17 +81,6 @@ do
[ $DO_REINSTALL -eq 0 ] && npm_reinstall [ $DO_REINSTALL -eq 0 ] && npm_reinstall
nice -n 19 npm run build:dev nice -n 19 npm run build:dev
echo "---RESTARTING CANVAS---" echo "---RESTARTING CANVAS---"
cp -r dist/*.js "${DEVFOLDER}/" copy "${DEVFOLDER}" "${DO_REINSTALL}"
cp -r dist/workers "${DEVFOLDER}/"
rm -rf "${DEVFOLDER}/public/assets"
cp -r dist/public "${DEVFOLDER}/"
cp -r dist/captchaFonts "${DEVFOLDER}/"
cp -r dist/package.json "${DEVFOLDER}/"
cp -r dist/assets.json "${DEVFOLDER}/"
cp -r dist/styleassets.json "${DEVFOLDER}/"
mkdir -p "${PFOLDER}/log"
cd "$DEVFOLDER"
[ $DO_REINSTALL -eq 0 ] && npm_reinstall
pm2 start ecosystem.yml
fi fi
done done