Skip to content

Commit

Permalink
run migrations and seed via env RUN_MIGRATIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
denistorresan committed Apr 29, 2024
1 parent 3cf0044 commit 1a2dc2f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deployment/start-container
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ set -e

container_mode=${CONTAINER_MODE:-http}
octane_server=${OCTANE_SERVER}
run_migrations=${RUN_MIGRATIONS:-false}
echo "Container mode: $container_mode"

initialStuff() {
php artisan optimize:clear; \
php artisan event:cache; \
php artisan config:cache; \
php artisan route:cache;

if [ ${run_migrations} = "true" ]; then
echo "Run migrations and seeding database ..."
php artisan migrate --seed --force;
fi
}

if [ "$1" != "" ]; then
Expand Down

0 comments on commit 1a2dc2f

Please sign in to comment.