EVO: script update-all > add param for bypasse migrate database (-b) & force to exec clear cache (-c)
parent
c9fd58f0d4
commit
b55e4509d1
|
@ -1,4 +1,26 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
bypass=0
|
||||||
|
forceClearCache=0
|
||||||
|
while getopts "hbc" option
|
||||||
|
do
|
||||||
|
case $option in
|
||||||
|
h)
|
||||||
|
echo -e "Update or install all Monarc modules, frontend views and migrate database."
|
||||||
|
echo -e "\t-b\tbypass migrate database"
|
||||||
|
echo -e "\t-c\tforce clear cache"
|
||||||
|
echo -e "\t-h\tdisplay this message"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
b)
|
||||||
|
bypass=1
|
||||||
|
echo "Migrate database don't execute !!!"
|
||||||
|
;;
|
||||||
|
c)
|
||||||
|
forceClearCache=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
pull_if_exists() {
|
pull_if_exists() {
|
||||||
if [ -d $1 ]; then
|
if [ -d $1 ]; then
|
||||||
|
@ -81,37 +103,10 @@ else
|
||||||
npm install
|
npm install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $bypass -eq 0 ]]; then
|
||||||
if [ -d $pathCore ]; then
|
migrate_module $phpcommand $pathCore
|
||||||
$phpcommand ./vendor/robmorgan/phinx/bin/phinx migrate -c ./$pathCore/migrations/phinx.php
|
migrate_module $phpcommand $pathBO
|
||||||
if [ -d "${pathCore}/hooks" ]; then
|
migrate_module $phpcommand $pathFO
|
||||||
cd $pathCore/.git/hooks
|
|
||||||
ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null
|
|
||||||
chmod u+x pre-commit
|
|
||||||
cd $currentPath
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d $pathBO ]; then
|
|
||||||
$phpcommand ./vendor/robmorgan/phinx/bin/phinx migrate -c ./$pathBO/migrations/phinx.php
|
|
||||||
|
|
||||||
if [ -d "${pathBO}/hooks" ]; then
|
|
||||||
cd $pathBO/.git/hooks
|
|
||||||
ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null
|
|
||||||
chmod u+x pre-commit
|
|
||||||
cd $currentPath
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d $pathFO ]; then
|
|
||||||
$phpcommand ./vendor/robmorgan/phinx/bin/phinx migrate -c ./$pathFO/migrations/phinx.php
|
|
||||||
|
|
||||||
if [ -d "$pathFO/hooks" ]; then
|
|
||||||
cd $pathFO/.git/hooks
|
|
||||||
ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null
|
|
||||||
chmod u+x pre-commit
|
|
||||||
cd $currentPath
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d node_modules/ng_backoffice ]; then
|
if [ -d node_modules/ng_backoffice ]; then
|
||||||
|
@ -129,10 +124,18 @@ fi
|
||||||
./scripts/link_modules_resources.sh
|
./scripts/link_modules_resources.sh
|
||||||
./scripts/compile_translations.sh
|
./scripts/compile_translations.sh
|
||||||
|
|
||||||
# Clear doctrine cache
|
if [[ $forceClearCache -eq 1 ]]; then
|
||||||
$phpcommand ./public/index.php orm:clear-cache:metadata
|
# Clear doctrine cache
|
||||||
$phpcommand ./public/index.php orm:clear-cache:query
|
# Move to MonarcCore Module.php
|
||||||
$phpcommand ./public/index.php orm:clear-cache:result
|
$phpcommand ./public/index.php orm:clear-cache:metadata
|
||||||
|
$phpcommand ./public/index.php orm:clear-cache:query
|
||||||
|
$phpcommand ./public/index.php orm:clear-cache:result
|
||||||
|
|
||||||
# Clear ZF2 cache
|
# Clear ZF2 cache
|
||||||
touch ./data/cache/upgrade && chmod 777 ./data/cache/upgrade
|
touch ./data/cache/upgrade && chmod 777 ./data/cache/upgrade
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $forceClearCache -eq 0 && $bypass -eq 0 ]]; then
|
||||||
|
# Clear ZF2 cache
|
||||||
|
touch ./data/cache/upgrade && chmod 777 ./data/cache/upgrade
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue