#!/bin/bash echo "######################" echo " time to update the framadate setup" echo "######################" COMMAND_BUILD="build:prod:demobliss" # git reset --hard git pull origin master composer install php bin/console doctrine:schema:update --force echo "######################" echo " update the funky frontend submodule " 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 " if [ ! -d "funky-framadate-front" ]; then # initiate sub directory for funky front git submodule init fi git config --global diff.submodule log git submodule update echo "######################" echo " check dependencies of the frontend with yarn " echo "######################" cd funky-framadate-front echo "######################" echo " debug info : version of programs" echo " " echo " git current branch " git show-branch echo " node version " node -v echo " yarn version " yarn -v echo " " echo "######################" git fetch git pull yarn echo "######################" echo " building the frontend " echo " npm run $COMMAND_BUILD " echo "######################" npm run $COMMAND_BUILD echo "######################" echo " copying built files in the public folder of the symfony project " echo "######################" cd ../public rm ./*.js rm ./*.css cd ../funky-framadate-front cp -r dist/framadate/* ../public/ COUNT_FILES=$(ls -larth ../public |wc -l) cd .. echo " $COUNT_FILES fichiers de build copiés dans /public" 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 " echo "######################"