-
-
Save devSarry/ed15394ad83ff8686830cbba97be896c to your computer and use it in GitHub Desktop.
Laravel Deployment
This file contains hidden or 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/sh | |
# | |
## store the arguments given to the script | |
read oldrev newrev refname | |
## Where to store the log information about the updates | |
LOGFILE=./post-receive.log | |
# The deployed directory (the running site) | |
DEPLOYDIR=/home/swamedia/source/portal-elogistics | |
## Record the fact that the push has been received | |
echo -e "Received Push Request at $( date +%F )" >> $LOGFILE | |
echo " - Old SHA: $oldrev New SHA: $newrev Branch Name: $refname" >> $LOGFILE | |
## Update the deployed copy | |
echo "Starting Deployment" >> $LOGFILE | |
echo " - Starting code update" | |
GIT_WORK_TREE="$DEPLOYDIR" git checkout -f | |
echo " - Finished code update" | |
echo " - Starting dependencies install & build" | |
cd "$DEPLOYDIR" | |
/home/swamedia/opt/bin/composer install --no-ansi --no-interaction --no-progress --no-scripts --optimize-autoloader | |
/home/swamedia/opt/node-v6.11.4-linux-x64/bin/npm run dev | |
cd - | |
echo " - Finished dependencies install & build" | |
echo " - Starting laravel optimization" | |
cd "$DEPLOYDIR" | |
#php artisan clear-compiled | |
php artisan cache:clear | |
php artisan view:clear | |
php artisan config:cache | |
php artisan route:cache | |
php artisan optimize | |
php artisan migrate | |
cd - | |
echo " - Finished laravel optimization" | |
echo "Finished Deployment" >> $LOGFILE |
This file contains hidden or 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
# Install application dependencies, such as the Laravel framework itself. | |
# | |
# If you run composer update in development and commit the `composer.lock` | |
# file to your repository, then `composer install` will install the exact | |
# same versions in production. | |
composer install --no-interaction | |
# npm run prod | |
php artisan clear:view | |
php artisan route:cache | |
php artisan config:cache | |
php artisan storage:link | |
# Clear the old boostrap/cache/compiled.php | |
php artisan clear-compiled | |
# Recreate boostrap/cache/compiled.php | |
php artisan optimize | |
# Migrate any database changes | |
php artisan migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment