Skip to content

Instantly share code, notes, and snippets.

@erickleandrolima
Created June 24, 2015 19:43
Show Gist options
  • Save erickleandrolima/0b11da6d727bea8691f6 to your computer and use it in GitHub Desktop.
Save erickleandrolima/0b11da6d727bea8691f6 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
# file: hooks/post-receive inside git repository.
$WORK_DIR=path/to/work/directory
$GIT_DIR=path/to/git/directory
git --work-tree=$WORK_DIR --git-dir=$GIT_DIR checkout -f
# enter work dir and download dependencies, set up env variables, etc.
cd $WORK_DIR
# downlaod composer
curl -sS https://getcomposer.org/installer | php
# install dependencies
php composer.phar install
@erickleandrolima
Copy link
Author

Put this script inside inside git directory in hooks folder. this file name is post-receive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment