Last active
October 30, 2015 14:02
Shell scripts used to synchronize Slicer GitHub with Slicer SVN. See http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_system/SlicerBot/SVN2GitHub
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/sh | |
remote=origin | |
logfile=/Volumes/Dashboards/SVN2Github/Slicer-SVN2GitHub-$remote-lastupdate-log.txt | |
clonedir=/Volumes/Dashboards/SVN2Github/Slicer-SVN2GitHub | |
giturl=git@github-slicerbot:Slicer/Slicer.git | |
svnurl=http://svn.slicer.org/Slicer4/trunk | |
NOW=$(date +'%T %D') | |
echo "" > $logfile | |
echo "$NOW - Updating [$giturl] using [$svnurl]" >> $logfile | |
echo "HOME: $HOME - USER: $USER - LOGNAME:$LOGNAME - SSH_AGENT_PID:$SSH_AGENT_PID - SSH_AUTH_SOCK:$SSH_AUTH_SOCK" >> $logfile | |
cd $clonedir | |
(/usr/bin/git checkout master && /usr/bin/git reset --hard git-svn && /usr/bin/git svn rebase && /usr/bin/git push $remote master --force) >> $logfile 2>&1 |
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/sh | |
# Adapted from http://linuxrhino.blogspot.com/2010/03/follow-up-to-using-passphrase-protected.html | |
# and http://stackoverflow.com/questions/11546765/how-to-get-the-pid-of-a-process-by-giving-the-process-name-in-mac-os-x | |
export SSH_AGENT_PID=`ps -A | grep -m1 ssh-agent | awk '{print $1}'` | |
export SSH_AUTH_SOCK=`find /tmp/ -name 'Listeners' -print 2>/dev/null` | |
cd /Volumes/Dashboards/SVN2Github | |
./Slicer-SVN2GitHub-slicerbot.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment