Wednesday, September 11, 2013

svn+ssh upadates(up) and co without password

In many cases people want to automate(scripting) the process for updating/checkout the source code from svn+ssh. For svn+ssh we require to enter password to interactive prompt. To avoid the pass interactive shell and provide password on the command line do following:

If you do not have sshpass installed please install it.

PS: do not export any variable, in the main terminal-shell itself. Export them into the script as exporting it in the main terminal shell may not ask you password at the time of checking in code into repository as well, which certainly nobody wants.

So write a small script 
 line following

#!/bin/bash
cd $local_repo_dir
export SVN_SSH="sshpass -e ssh"
export SSHPASS="ssh_password_to_remote_repository_server"
svn co
svn up


No comments:

Post a Comment