run.sh for automatic deployments
This commit is contained in:
parent
3c6232c151
commit
303e3a1c0c
25
run.sh
25
run.sh
|
@ -1,22 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Run setup only if .env file doesn't exist.
|
# Load environment variables from .env.production
|
||||||
if [ ! -e .env.production ]
|
set -o allexport
|
||||||
then
|
source .env.production
|
||||||
cat > .env.production << EOF
|
set +o allexport
|
||||||
APP_NAME=MyIdlers
|
|
||||||
APP_DEBUG=false
|
|
||||||
APP_KEY=
|
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
# Check if the database file exists and is not empty
|
||||||
DB_HOST=${DB_HOST}
|
if [ ! -s $DB_DATABASE ]
|
||||||
DB_DATABASE=${DB_DATABASE}
|
then
|
||||||
DB_USERNAME=${DB_USERNAME}
|
touch $DB_DATABASE
|
||||||
DB_PASSWORD=${DB_PASSWORD}
|
php artisan migrate:fresh --seed --force
|
||||||
APP_URL=${APP_URL}
|
|
||||||
EOF
|
|
||||||
php artisan key:generate --no-interaction --force
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# php artisan migrate:fresh --seed
|
|
||||||
php artisan serve --host=0.0.0.0 --port=8000 --env=production
|
php artisan serve --host=0.0.0.0 --port=8000 --env=production
|
Loading…
Reference in New Issue
Block a user