Connect to VPN connection before GIT pull

I am trying to set up an application testing environment using Jenkins.

Since the GIT repository is on a different separate network, a VPN connection must be established to establish a connection between Jenkins and GIT.

So, is there a way to establish a VPN connection before the GIT pull stage?

I have a CLI command to start / stop a VPN connection. I am currently using "Post Steps" in the "Execute Shell Script" section to run a command to stop the VPN connection.

+3


source to share


1 answer


You can see if a plugin like OpenConnect can help .
As mentioned in this answer , you then ran a startup task called "Connect to Cisco AnyConnect VPN". If this job is successful, you can start your normal job using the Git url.

For this Git url, you may need to install the ssh tunnel .



ssh -L3333:git.example.com:22 you@proxy.example.com
git clone ssh://git@localhost:3333/example.git

      

The first command will be part of the first job I mentioned above, the one that starts the VPN.
The second line, ssh url one, will be used in the Git url field of the second job (which should get sources).
This second work, as a post-build step, can then clone the VPN.

0


source







All Articles