finish deploy script
This commit is contained in:
53
deploy.sh
53
deploy.sh
@@ -1,9 +1,48 @@
|
||||
git pull origin production
|
||||
#!/bin/bash
|
||||
|
||||
composer install
|
||||
php artisan migrate --force
|
||||
php artisan test
|
||||
php artisan optimize
|
||||
input=".env"
|
||||
while IFS= read -r line
|
||||
do
|
||||
if [ "APP_ENV" == "${line%=*}" ];
|
||||
then
|
||||
env="${line##*=}"
|
||||
fi
|
||||
|
||||
npm install
|
||||
npm run prod
|
||||
if [ "DB_DATABASE" == "${line%=*}" ];
|
||||
then
|
||||
database="${line##*=}"
|
||||
fi
|
||||
|
||||
if [ "DB_USERNAME" == "${line%=*}" ];
|
||||
then
|
||||
user="${line##*=}"
|
||||
fi
|
||||
|
||||
if [ "DB_PASSWORD" == "${line%=*}" ];
|
||||
then
|
||||
pass="${line##*=}"
|
||||
fi
|
||||
|
||||
done < "$input"
|
||||
|
||||
year=$(date +"%Y")
|
||||
month=$(date +"%m")
|
||||
day=$(date +"%d")
|
||||
hour=$(date +"%H")
|
||||
minutes=$(date +"%M")
|
||||
|
||||
mysqldump --user="$user" --password="$pass" -B "$database" > storage/logs/database/save_$database_$year$month$day_$hour$minutes.sql
|
||||
|
||||
if [ "production" == "$env" ];
|
||||
then
|
||||
echo "en production"
|
||||
git pull origin production
|
||||
|
||||
composer install
|
||||
php artisan migrate --force
|
||||
php artisan test
|
||||
php artisan optimize
|
||||
|
||||
npm install
|
||||
npm run prod
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user