Created
January 5, 2010 17:49
-
-
Save winhamwr/269554 to your computer and use it in GitHub Desktop.
bash script for use by a hudson job to deploy a project via fabric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SSHAGENT=/usr/bin/ssh-agent | |
SSHAGENTARGS="-s" | |
PARENT_JOB=pstat_master_unittest | |
KEY_PATH=$HOME/policystat/fabric/pstat_dev.key | |
if [ ! -z "$WORKSPACE" ]; then | |
WORKSPACE=/vol/fs/var/lib/hudson/home/jobs/pstat_master_deploy/workspace | |
fi | |
set -e | |
set -v | |
set -x | |
# Start the ssh-agent | |
if [ -z "$SSH_AUTH_SOCK" ]; then | |
eval `$SSHAGENT $SSHAGENTARGS` | |
trap "kill $SSH_AGENT_PID" 0 | |
fi | |
echo $SSH_AGENT_PID | |
/usr/bin/ssh-add $KEY_PATH | |
. $WORKSPACE/../../../virtualenvs/$PARENT_JOB/bin/activate | |
cd $WORKSPACE/../../$PARENT_JOB/workspace/pstat | |
fab test update deploy &> $WORKSPACE/fabric.out | |
set +x | |
# Kill ssh-agent | |
ssh-add -D | |
ssh-agent -k > /dev/null 2>&1 | |
unset SSH_AGENT_PID | |
unset SSH_AUTH_SOCK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment