-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy-script.txt
42 lines (31 loc) · 1.04 KB
/
deploy-script.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cd /home/forge/<mydomain.com>
git pull origin master
# Turn on maintenance mode
$FORGE_PHP artisan down
# Pull the latest changes from the git repository
git pull origin master
# Install/update composer dependecies
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader --no-dev
# Whaddaffuck?
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock
if [ -f artisan ]; then
# Run database migrations
$FORGE_PHP artisan migrate --force
# Clear caches
$FORGE_PHP artisan cache:clear
# Clear expired password reset tokens
$FORGE_PHP artisan auth:clear-resets
# Clear and cache routes
$FORGE_PHP artisan route:clear
$FORGE_PHP artisan route:cache
# Clear and cache config
$FORGE_PHP artisan config:clear
$FORGE_PHP artisan config:cache
# Install node modules
npm install
# Build assets using Laravel Mix
npm run production
# Turn off maintenance mode
$FORGE_PHP artisan up
fi