Skip to content

Instantly share code, notes, and snippets.

@diegogurpegui
Last active July 11, 2018 13:39
Show Gist options
  • Save diegogurpegui/afddfb818409d3a60656be941c64eb1d to your computer and use it in GitHub Desktop.
Save diegogurpegui/afddfb818409d3a60656be941c64eb1d to your computer and use it in GitHub Desktop.
Script to deploy a Laravel project from a Git repository
#!/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