Created
April 20, 2016 07:35
-
-
Save nikosolihin/63b1c0fc19aaff935f53f3aafdb393e9 to your computer and use it in GitHub Desktop.
Git post-receive hook
This file contains 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 | |
# App directories | |
APP_WEB_DIR="/home/[godaddy-user]/public_html" | |
APP_GIT_DIR="/home/[godaddy-user]/git/prod.git/" | |
# Copy the repo content to the server live directory | |
git --work-tree=${APP_WEB_DIR} --git-dir=${APP_GIT_DIR} checkout -f | |
# Clean the app directory (use --exclude=[pattern] to exclude some file) | |
git --work-tree=${APP_WEB_DIR} clean -fd | |
# Run composer | |
cd ${APP_WEB_DIR} | |
composer install | |
# Do other things here, for example load database changes automatically |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment