Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
bash script for use by a hudson job to deploy a project via fabric
#!/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
You can’t perform that action at this time.