Last active
June 19, 2020 17:45
-
-
Save spont4e/1f7fe0f4771898f036e2b6b2df4297cd to your computer and use it in GitHub Desktop.
Simple Laravel Deploy
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/bash -e | |
| git="/usr/bin/git" | |
| php="/usr/bin/php7.2" | |
| composer="/usr/bin/composer" | |
| npm="/usr/bin/npm" | |
| wwwdir="/var/www/your-site/" | |
| artisan=$wwwdir"artisan" | |
| update="/var/tmp/your-site-update.txt" | |
| log="/var/log/deploy/your-site.log" | |
| if [ -f "$update" ]; then | |
| echo "[$(date '+%F %T')] Updating..." >> $log | |
| cd $wwwdir && | |
| $git pull && | |
| cp .env.production .env && | |
| $php $composer install && | |
| $php $artisan migrate --force && | |
| $npm install && | |
| $npm run prod && | |
| $php $artisan optimize && | |
| rm $update | |
| echo "[$(date '+%F %T')] Update complete!" >> $log | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment