Skip to content

Commit b629e7d

Browse files
authored
Merge pull request #608 from dbarzin/dev
fix init script
2 parents 4a449c7 + e799296 commit b629e7d

File tree

4 files changed

+8
-19
lines changed

4 files changed

+8
-19
lines changed

database/seeds/DatabaseSeeder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function run()
2727
'email' => 'admin@admin.localhost',
2828
'password' => bcrypt('admin'),
2929
]);
30+
3031
}
3132
}
3233
}

docker/docker-compose.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@ services:
66
environment:
77
### PLEASE DISABLE AFTER THE FIRST RUN FOR OPTIMIZATION PRODUCTION
88
- DB_SLEEP=10
9-
### PLEASE DISABLE FOR PRODUCTION
10-
# - USE_DEMO_DATA=0
11-
### PLEASE DISABLE FOR PRODUCTION
12-
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
13-
# - UPLOAD_DB_ISO27001=FR #EN OR FR
14-
# - APP_BANNER_TEST=false
15-
### PLEASE AFTER ONE RUN DISABLE FOR OPTIMIZATION
16-
# - INITIAL_DB=FR #EN OR FR
9+
# Default timezone
1710
- TZ=Europe/Paris
11+
# Default db connexion
1812
- DB_HOST=mysql
1913
- APP_ENV=local
2014
- DB_DATABASE=deming

docker/initialdb.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22

33
echo "Initialize database"
44

5+
# Migarte the database
56
php artisan migrate
67

7-
if [ "${INITIAL_DB}" = "EN" ]; then
8-
php artisan db:seed --class=DatabaseSeeder
9-
elif [ "${INITIAL_DB}" = "FR" ]; then
10-
LANG=fr php artisan db:seed --class=DatabaseSeeder
11-
else
12-
echo "WARNING: INITIAL_DB='${INITIAL_DB}' non reconnu (EN ou FR attendu)."
13-
exit 1
14-
fi
15-
8+
# Create the admin user if it does not exist
9+
php artisan db:seed --class=DatabaseSeeder

docker/resetdb.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ if [ "${RESET_DB}" = "EN" ]; then
2222
# Se déplace vers le répertoire /var/www/deming/
2323
cd /var/www/deming/
2424
# Exécute la commande
25-
php artisan migrate:fresh --seed --force
25+
php artisan migrate:fresh --seed
2626
# Exit avec le code 0 pour indiquer que le script s'est terminé avec succès
2727
exit 0
2828
fi
2929
if [ "${RESET_DB}" = "FR" ]; then
3030
# Se déplace vers le répertoire /var/www/deming/
3131
cd /var/www/deming/
3232
# Exécute la commande
33-
LANG=fr php artisan migrate:fresh --seed --force
33+
LANG=fr php artisan migrate:fresh --seed
3434
# Exit avec le code 0 pour indiquer que le script s'est terminé avec succès
3535
exit 0
3636
fi

0 commit comments

Comments
 (0)