Commit c4bc1ff0f8744862b0447b5d940f6bea61dee995
1 parent
ff7bd86a
Exists in
master
and in
1 other branch
amelioration scripts qui se connectent a la bd pour qu'ils marchent dans tous le…
…s cas (avec ou sans docker, et si docker appel direct ou indirect)
Showing
4 changed files
with
34 additions
and
8 deletions
Show diff stats
ADD_NEW_SUPERADMIN_LDAP_USER
... | ... | @@ -3,6 +3,16 @@ |
3 | 3 | # -- Ajout d'un nouvel utilisateur superadmin |
4 | 4 | # (qui doit correspondre à un utilisateur référencé dans l'annuaire LDAP) |
5 | 5 | |
6 | +# Si execution directe depuis le repertoire data/ (bind du repertoire docker) | |
7 | +# => on rappelle ce meme script avec le CLI docker puis on exit | |
8 | +if [[ -f ../DOCKER_LABINVENT_START ]] ; then | |
9 | + #cd ../ | |
10 | + docker exec -it labinvent $0 | |
11 | + exit | |
12 | +fi | |
13 | +echo "IN $(pwd)" | |
14 | + | |
15 | + | |
6 | 16 | # INPUT args |
7 | 17 | # $1 = platforme (par défaut linux) |
8 | 18 | ... | ... |
CAKE_SHELL
1 | 1 | #!/usr/bin/env bash |
2 | 2 | |
3 | +# Si execution directe depuis le repertoire data/ (bind du repertoire docker) | |
4 | +# => on rappelle ce meme script avec le CLI docker puis on exit | |
5 | +if [[ -f ../DOCKER_LABINVENT_START ]] ; then | |
6 | + #cd ../ | |
7 | + docker exec -it labinvent $0 | |
8 | + exit | |
9 | +fi | |
10 | +echo "IN $(pwd)" | |
11 | + | |
3 | 12 | #[ -f src/Application.php ] && rm src/Application.php |
4 | 13 | cp src/Application.php.37 src/Application.php |
5 | 14 | ... | ... |
CONNECT_TO_MYSQL_AS_USER
1 | 1 | #!/usr/bin/env bash |
2 | 2 | |
3 | -# AVEC DOCKER ? | |
4 | -if [[ -f ../DOCKER_LABINVENT_DB_USER ]] ; then | |
5 | - cd ../ | |
6 | - ./DOCKER_LABINVENT_DB_USER | |
7 | - exit | |
3 | +# Si execution directe depuis le repertoire data/ (bind du repertoire docker) | |
4 | +# => on rappelle ce meme script avec le CLI docker puis on exit | |
5 | +if [[ -f ../DOCKER_LABINVENT_START ]] ; then | |
6 | + #cd ../ | |
7 | + docker exec -it labinvent $0 | |
8 | + exit | |
8 | 9 | fi |
10 | +echo "IN $(pwd)" | |
9 | 11 | |
10 | 12 | |
11 | -# SANS DOCKER | |
12 | -source install/ENV.sh | |
13 | +# Si fichier install/ENV.sh existe, alors mode SANS docker | |
14 | +[ -f install/ENV.sh ] && source install/ENV.sh | |
15 | + | |
13 | 16 | #echo $MYSQL_USER |
14 | 17 | #echo $MYSQL_PASSWORD |
15 | 18 | |
... | ... | @@ -17,7 +20,8 @@ source install/ENV.sh |
17 | 20 | #MYSQL_PORT=$(echo "$MYSQL_PORT" | cut -d':' -f 2) |
18 | 21 | #echo $MYSQL_PORT #3307 |
19 | 22 | |
20 | -mysql $MYSQL_DATABASE -h 127.0.0.1 -u $MYSQL_USER -p$MYSQL_PASSWORD | |
23 | +mysql $MYSQL_DATABASE -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD | |
24 | +#mysql $MYSQL_DATABASE -h 127.0.0.1 -u $MYSQL_USER -p$MYSQL_PASSWORD | |
21 | 25 | #mysql -h 127.0.0.1 -u $MYSQL_USER -P $MYSQL_PORT --protocol=tcp -p$MYSQL_PASSWORD |
22 | 26 | #mysql -h 127.0.0.1 -u $MYSQL_USER -P $MYSQL_PORT -p$MYSQL_PASSWORD |
23 | 27 | ... | ... |
install/installation.sh
... | ... | @@ -393,7 +393,10 @@ else |
393 | 393 | fi |
394 | 394 | echo "==> Adresse du serveur MySql = $bddIp" |
395 | 395 | #sed -e "s#/\*d\*/'host' => 'localhost'//\*d\*/'host' => '$bddIp'/" -i $config_file |
396 | +# PROD BD | |
396 | 397 | sed -e "s/\*d\*\/'host' => 'localhost'/\*d\*\/'host' => '$bddIp'/" -i $config_file |
398 | +# TEST BD | |
399 | +sed -e "s/\*t\*\/'host' => 'localhost'/\*d\*\/'host' => '$bddIp'/" -i $config_file | |
397 | 400 | |
398 | 401 | |
399 | 402 | # - Nom de la BD prod | ... | ... |