Last active
July 11, 2018 13:39
-
-
Save diegogurpegui/afddfb818409d3a60656be941c64eb1d to your computer and use it in GitHub Desktop.
Script to deploy a Laravel project from a Git repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fetch from repository | |
git fetch origin | |
reslog=$(git log HEAD..origin/master --oneline) | |
git reset --hard origin/master | |
if [ "${reslog}" != "" ] ; then | |
git merge origin/master # completing the pull | |
# Project dependencies install/update | |
composer install --no-dev --optimize-autoloader | |
# Run migrations | |
php artisan migrate | |
# Prepare Laravel cache | |
php artisan config:cache | |
# Prepare Laraver routes | |
php artisan route:cache | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment