Skip to content

Instantly share code, notes, and snippets.

@geraintwhite
Last active January 25, 2016 09:40
Show Gist options
  • Save geraintwhite/49b91a42007d1c977396 to your computer and use it in GitHub Desktop.
Save geraintwhite/49b91a42007d1c977396 to your computer and use it in GitHub Desktop.
Setup file for deployment system
#!/bin/bash
ssh_url="[email protected]"
base_path="/home/git/deploy"
repo_dir="$base_path/repos"
processing="$base_path/processing"
getter="$base_path/github-getter"
post_receive="$base_path/post-receive"
full_name="itsapi/github-getter"
git clone --bare "$ssh_url:$full_name" "$repo_dir/$full_name.git"
mkdir -p $getter
cd "$repo_dir/$full_name.git"
GIT_WORK_TREE=$getter git checkout -f
$getter/get.sh $repo_dir $post_receive "itsapi/post-receive" "master"
$getter/get.sh $repo_dir $processing "itsapi/github-listener" "master"
$post_receive/bin/post-receive -p $processing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment