Skip to content

Instantly share code, notes, and snippets.

@philchristensen
Created September 19, 2014 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philchristensen/f1920e5a4bf05881ccea to your computer and use it in GitHub Desktop.
Save philchristensen/f1920e5a4bf05881ccea to your computer and use it in GitHub Desktop.
Simpler Git/Gitolite post-update hook for single modules
#!/bin/bash
branch=$(git rev-parse --symbolic --abbrev-ref $1)
module=$(basename $PWD)
valid=0
if [[ "$module" == "puppet.git" ]]; then
valid=1
modulename="dram"
fi
if [[ "$valid" == "1" ]]; then
echo "Updating puppet module $modulename for $branch..."
eval `ssh-agent`
ssh-add ~/.ssh/jenkins-key
ssh -A jenkins@puppet.dramonline.net -i ~/.ssh/jenkins-key "cd$
ssh-agent -k
fi
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment