You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/bin/sh
# directories
APP_WEB_DIR="/var/www/[app]"
APP_GIT_DIR="/git/[app].git"
# checkout the last commit inside the web app directory
git --work-tree=${APP_WEB_DIR} --git-dir=${APP_GIT_DIR} checkout -f
Laravel example
#!/bin/sh
# directories
APP_WEB_DIR="/var/www/[app]"
APP_GIT_DIR="/git/[app].git"
# checkout the last commit inside the web app directory
git --work-tree=${APP_WEB_DIR} --git-dir=${APP_GIT_DIR} checkout -f
# run composer (NOTE: requires composer to be installed beforehand)
cd ${APP_WEB_DIR}
composer install
# ensure storage is writable
chmod -R g+w storage
# run optimizations
# php artisan config:cache
# php artisan route:cache
# do other things here if needed
# php artisan migrate
From the local repo
Go to the project folder
cd /path/to/your/project
Add the production server URL
git remote add production ssh://[user]@[domain]/git/[app].git
Big thanks to this post by netgloo for opening my eyes to this simple workflow. I've been referring to it for over 5 years now, and figured I'd re-write it elsewhere just in case it ever got taken down.
Big thanks to this post by netgloo for opening my eyes to this simple workflow. I've been referring to it for over 5 years now, and figured I'd re-write it elsewhere just in case it ever got taken down.