Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
PARENT_JOB=pstat_master_unittest
KEY_PATH=$HOME/policystat/fabric/pstat_dev.key
PROJECT_ROOT=/var/www/pstattest.com/
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
# Load initial fixtures
cd $PROJECT_ROOT/pstat/
./manage.py reset_db --noinput && ./manage.py syncdb --noinput --migrate
python $PROJECT_ROOT/scripts/load_testing_fixtures.py
set +x
# Kill ssh-agent
ssh-add -D
set +e
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.