Laravel Deploy Script

I found this example on gists page of Github. Was writed by github.com/BenSampo

# Change to the project directory
cd $FORGE_SITE_PATH

# Turn on maintenance mode
php artisan down || true

# Pull the latest changes from the git repository
# git reset…


This content originally appeared on DEV Community and was authored by Alexandre Freire

I found this example on gists page of Github. Was writed by github.com/BenSampo

# Change to the project directory
cd $FORGE_SITE_PATH

# Turn on maintenance mode
php artisan down || true

# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH

# Install/update composer dependecies
composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev

# Restart FPM
( flock -w 10 9 || exit 1
    echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock

# Run database migrations
php artisan migrate --force

# Clear caches
php artisan cache:clear

# Clear expired password reset tokens
php artisan auth:clear-resets

# Clear and cache routes
php artisan route:cache

# Clear and cache config
php artisan config:cache

# Clear and cache views
php artisan view:cache

# Install node modules
# npm install

# Build assets using Laravel Mix
# npm run production

# Turn off maintenance mode
php artisan up


This content originally appeared on DEV Community and was authored by Alexandre Freire


Print Share Comment Cite Upload Translate Updates
APA

Alexandre Freire | Sciencx (2021-07-16T20:14:15+00:00) Laravel Deploy Script. Retrieved from https://www.scien.cx/2021/07/16/laravel-deploy-script/

MLA
" » Laravel Deploy Script." Alexandre Freire | Sciencx - Friday July 16, 2021, https://www.scien.cx/2021/07/16/laravel-deploy-script/
HARVARD
Alexandre Freire | Sciencx Friday July 16, 2021 » Laravel Deploy Script., viewed ,<https://www.scien.cx/2021/07/16/laravel-deploy-script/>
VANCOUVER
Alexandre Freire | Sciencx - » Laravel Deploy Script. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/16/laravel-deploy-script/
CHICAGO
" » Laravel Deploy Script." Alexandre Freire | Sciencx - Accessed . https://www.scien.cx/2021/07/16/laravel-deploy-script/
IEEE
" » Laravel Deploy Script." Alexandre Freire | Sciencx [Online]. Available: https://www.scien.cx/2021/07/16/laravel-deploy-script/. [Accessed: ]
rf:citation
» Laravel Deploy Script | Alexandre Freire | Sciencx | https://www.scien.cx/2021/07/16/laravel-deploy-script/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.