Skip to content

Instantly share code, notes, and snippets.

@BrianHicks
Created June 17, 2013 22:05
Show Gist options
  • Save BrianHicks/5800920 to your computer and use it in GitHub Desktop.
Save BrianHicks/5800920 to your computer and use it in GitHub Desktop.
git-remote:
root: /opt/git-remote
repos:
- name: salt-repo
hooks:
post-receive: |
#!/bin/bash
echo "-------- pulling to /srv/salt --------"
test -d /srv/salt || mkdir -p /srv/salt
pushd /srv/salt
test -d .git || git init .
git remote | grep -q local || git remote add local /opt/git-remote/salt-repo
git pull local master
popd
echo "-------- running highstate --------"
salt-call state.highstate --log-level warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment