Commit 20f1aa984f9cb8eb0a3b70b651e9bd02a142c178
1 parent
42c8c622
Exists in
master
and in
3 other branches
bugfix script db update pour mac os
Showing
2 changed files
with
3 additions
and
35 deletions
Show diff stats
database/update/db-update-2017-08-23.sh
1 | 1 | #!/bin/bash |
2 | 2 | |
3 | -myname=`basename $0 .sh` | |
3 | +#myname=`basename $0 .sh` | |
4 | +myname=`basename $0` | |
5 | +myname=${myname%%.*} | |
4 | 6 | |
5 | 7 | # Pour Mac OS recent (10.10, Yosemite), la syntaxe du SED est differente |
6 | 8 | # Il faut donc faire une copie de ce fichier et transformer les instructions sed a l'interieur | ... | ... |
database/update/db-update-modele.sh deleted
... | ... | @@ -1,34 +0,0 @@ |
1 | -#!/bin/bash | |
2 | - | |
3 | -# Pour Mac OS recent (10.10, Yosemite), la syntaxe du SED est differente | |
4 | -# Il faut donc faire une copie de ce fichier et transformer les instructions sed a l'interieur | |
5 | -# Pour cela, il suffit d'executer ces 2 lignes : | |
6 | -# cp ce_script.sh ce_script_macosx.sh | |
7 | -# sed -e "s/ -i / -i '' /" -i '' ce_script_macosx.sh | |
8 | - | |
9 | -if [ ! -f ../../config/app.php ] ; then | |
10 | -echo "Vous devez executer ce script depuis le dossier database/update/" | |
11 | -exit 1 | |
12 | -fi | |
13 | - | |
14 | - | |
15 | -# Get login, pass, dbname, and hostname | |
16 | -username=$(grep "/\*d\*/'username'" ../../config/app.php | cut -d"'" -f4) | |
17 | -password=$(grep "/\*d\*/'password'" ../../config/app.php | cut -d"'" -f4) | |
18 | -database=$(grep "/\*d\*/'database'" ../../config/app.php | cut -d"'" -f4) | |
19 | -host=$(grep "/\*d\*/'host'" ../../config/app.php | cut -d"'" -f4) | |
20 | - | |
21 | - | |
22 | -cp -p ./script_sql/db-update-xxxx-xx-xx.sql ./script_sql/db-update-xxxx-xx-xx-build.sql | |
23 | - | |
24 | -# Execute sql update script | |
25 | -sed -e "s/database/$database/" -i ./script_sql/db-update-xxxx-xx-xx-build.sql | |
26 | -mysql --user=$username --password=$password -h $host < ./script_sql/db-update-xxxx-xx-xx-build.sql | |
27 | - | |
28 | -# Delete cakephp cache | |
29 | -sudo rm ../../tmp/cache/models/* | |
30 | -sudo rm ../../tmp/cache/persistent/* | |
31 | - | |
32 | -sudo chmod -R 777 ../../tmp | |
33 | -sudo chmod -R 777 ../../vendor | |
34 | -sudo chmod -R 777 ../../webroot |