date-poll-api/update.sh

96 lines
2.4 KiB
Bash
Raw Normal View History

2019-12-30 19:12:47 +01:00
#!/bin/bash
echo "######################"
echo " time to update the framadate setup"
echo "######################"
2021-02-12 15:23:27 +01:00
COMMAND_BUILD="build:prod:demobliss"
2021-02-12 14:39:45 +01:00
# git reset --hard
2019-12-30 19:12:47 +01:00
git pull origin master
composer install
php bin/console doctrine:schema:update --force
echo "######################"
2021-02-12 14:39:45 +01:00
echo " update the funky frontend submodule "
2021-02-12 16:09:16 +01:00
echo "############################################"
echo " verification des besoins de l'application "
echo "############################################"
if [ ! hash yarn ]; then
echo "la commande yarn est introuvable"
exit 1
fi
echo " ✅ yarn"
if [ ! hash git ]; then
echo "la commande git est introuvable"
exit 1
fi
echo " ✅ git"
if [ ! -f .env || ! -f .env.local ]; then
echo "fichier d'environnement de symfony"
exit 1
fi
echo " ✅ fichier d'environnement de symfony /.env ou /.env.local"
if [ ! -f bin/console ]; then
echo "fichier console de symfony"
exit 1
fi
echo " ✅ fichier console de symfony /bin/console "
2021-02-12 15:02:33 +01:00
if [ ! -d "funky-framadate-front" ]; then
# initiate sub directory for funky front
git submodule init
fi
git config --global diff.submodule log
2019-12-30 19:12:47 +01:00
git submodule update
echo "######################"
echo " check dependencies of the frontend with yarn "
echo "######################"
cd funky-framadate-front
2021-02-12 15:02:33 +01:00
echo "######################"
echo " debug info : version of programs"
echo " "
2021-02-12 15:04:21 +01:00
echo " git current branch "
git show-branch
echo " node version "
2021-02-12 15:02:33 +01:00
node -v
2021-02-12 15:04:21 +01:00
echo " yarn version "
2021-02-12 15:02:33 +01:00
yarn -v
2021-02-12 15:04:21 +01:00
echo " "
2021-02-12 15:02:33 +01:00
echo "######################"
2021-02-12 15:23:27 +01:00
git fetch
git pull
2019-12-30 19:12:47 +01:00
yarn
echo "######################"
echo " building the frontend "
2021-02-12 15:23:27 +01:00
echo " npm run $COMMAND_BUILD "
2019-12-30 19:12:47 +01:00
echo "######################"
2021-02-12 15:23:27 +01:00
npm run $COMMAND_BUILD
2021-02-12 14:39:45 +01:00
2019-12-30 19:12:47 +01:00
echo "######################"
echo " copying built files in the public folder of the symfony project "
echo "######################"
2021-02-12 15:53:28 +01:00
cd ../public
rm ./*.js
rm ./*.css
cd ../funky-framadate-front
2021-02-12 15:23:27 +01:00
cp -r dist/framadate/* ../public/
2021-02-12 15:53:28 +01:00
COUNT_FILES=$(ls -larth ../public |wc -l)
2021-02-12 15:23:27 +01:00
cd ..
echo " $COUNT_FILES fichiers de build copiés dans /public"
2021-02-12 15:53:28 +01:00
echo "##################################################################"
echo " renaming unieque name of JS chunks to common names for templates "
cd public
mv runtime* runtime.js
mv main* main.js
mv polyfills-es5* es5-polyfills.js
mv polyfills* other-polyfills.js
mv scripts* scripts.js
mv styles* styles.css
echo "##################################################################"
echo " $(date) ------- done "
2019-12-30 19:12:47 +01:00
echo "######################"