Last active
August 29, 2015 13:56
-
-
Save lnpbk/9089160 to your computer and use it in GitHub Desktop.
Post receive hook v0.1
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 | |
USERNAME="user"; | |
GROUPNAME="www-data"; | |
WORKDIR="/path/to/git/root"; | |
# Checkout the latest commit | |
GIT_WORK_TREE=${WORKDIR} git checkout -f | |
# Set file owner | |
sudo chown -R ${USERNAME}:${GROUPNAME} ${WORKDIR}; | |
# Very time consuming | |
# http://ryansechrest.com/2013/08/managing-file-and-folder-permissions-when-deploying-with-git/ | |
# find ${WORKDIR} -type d -exec sudo chmod -R 775 {} \; | |
# find ${WORKDIR} -type f -exec sudo chmod 664 {} \; | |
# Install dependencies | |
cd ${WORKDIR}/htdocs; | |
composer install --no-dev --prefer-dist; | |
# Run Laravel migrations | |
php artisan migrate --env=test; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment