Skip to content

Instantly share code, notes, and snippets.

@EduardoMRB
Last active August 29, 2015 14:22
Show Gist options
  • Save EduardoMRB/fca9a8cef521b6c60a13 to your computer and use it in GitHub Desktop.
Save EduardoMRB/fca9a8cef521b6c60a13 to your computer and use it in GitHub Desktop.
PHP deploy skeleton
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment