eliteregistry/post_deploy.sh
Matt Burchett 61883a6550
All checks were successful
continuous-integration/drone/push Build is passing
Fixing logging and changing post deploy
2021-04-07 00:22:20 -07:00

33 lines
712 B
Bash

#!/usr/bin/env bash
# update application cache
php artisan optimize
# perform DB migrations
if [[ ! -f ./database/database.sqlite ]]; then
echo "No link to database. Linking database."
ln -s /data/database.sqlite ./database/database.sqlite
fi
if [[ ! -f /data/database.sqlite ]]; then
echo "No database found. Creating."
touch /data/database.sqlite
fi
if [[ ! -f ./.env ]]; then
echo "No link to environment. Linking environment."
ln -s /data/.env ./.env
fi
if [[ ! -f /data/.env ]]; then
echo "No environment found. Creating."
cp .env.example /data/.env
php artisan key:generate --force
fi
php artisan migrate
# start the application
php-fpm -D && nginx -g "daemon off;"