I need to create a tunnel like the following before code can be checked out from SVN :
ssh -L 9898:some_server.com:9898 user@another_server.com
Now, I added pre-scm-buildstep plugin and wrote a script to open the tunnel before updating the repository as explained here, but it doesn’t work with polling. It only works if I ask Jenkins to ‘Build now‘. In the setup where I have set it up to poll, its red saying that its unable to access the repository url, which can only happen if the tunnel was not created.
Is there any plugin such that I can execute a script before it polls, so that I can open the tunnel before it starts polling
Use ProxyCommand in your ssh config to have ssh automatically create the tunnel for you. e.g.,
With the above in ~jenkins/.ssh/config (or whatever user jenkins runs as), when it tries to ssh to
another_server.comit will actually ssh tosome_server.comand runncto forward the ssh connection to theanother_server.com.