1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00
date-poll-api/update.sh

70 lines
1.8 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 "
2019-12-30 19:12:47 +01:00
echo "######################"
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 "######################"