1

Ok, this is kinda related to a previous question i asked; Cannot do git-svn fetch behind proxy

But this time I need an automated jenkins script that does git svn fetch to a repository that's outide our proxy.

As I found out in the other question, git-svn uses the proxy settings that's specified in the file servers. And servers is located at ~/.subversion.

Jenkins is set up on a machine running Windows server 2008, and I've searched for every servers file on the machine and modified them all, but I still isn't able to do git svn fetch without failing at the proxy.

I've tried to put a .subversion folder in the workspace, since ~ evaluates to the current workspace (I think) in jenkins, but that didn't work either.

Any other ideas?

Community
  • 1
  • 1
bjarven
  • 771
  • 2
  • 10
  • 27

2 Answers2

1

I think the http_proxy and https_proxy environment variables are ignored by both Git and Subversion.

You can check inside a jenkins job where the ~ path is with a small powershell script:

get-item  ~

I guess it will be:

C:\Users\MYUSER.subversion\servers

S.Spieker
  • 7,005
  • 8
  • 44
  • 50
  • This is interesting! I also think those environment variables won't matter. When I do `get-item ~` it says the variable Isn't set. The error message recommends setting it with `(get-psprovider 'FileSystem').Home = 'path'`, and I've tried that but it still won't work. Do you know if setting it only will affect the powershell environment or also git and svn? – bjarven Mar 16 '15 at 13:45
  • It seems to be local for the powershell instance. – bjarven Mar 16 '15 at 13:50
0

Simply try and set, either as environment variable on the machine, or as environment variable on the job itself (with the EnvInject plugin) the variables:

HTTP_PROXY=http://<username>:<password>@<proxy>:<port>
HTTPS_PROXY=http://<username>:<password>@<proxy>:<port>
NO_PROXY=.<company>

Having the password set directly isn't secure, but this is only for testing, for you to check if the git svn clone can proceed.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for the reply, I tried and it didn't work unfortunately. But that plugin was nice, it'll probably come in handy sometime. :) – bjarven Mar 10 '15 at 10:04
  • @bjarven strange, it should have worked. I like the plugin as it avoids setting env variables for one user before discovering Jenkins is running as another user. – VonC Mar 10 '15 at 10:21
  • I've tried setting the HTTP_PROXY and HTTPS_PROXY directly as system variables before, and that didn't work either. I guess git svn looks for the proxy setting in some strange place... :/ – bjarven Mar 10 '15 at 10:23
  • @bjarven I just had an issue with EnvInject where the environment variable wasn't recognized when it was written in all uppercase. Can you try with: `Http_proxy=http://...` (first letter in uppercase, the rest in lowercase)? – VonC Mar 13 '15 at 06:33
  • Ok, tried that and still no result I'm afraid... :( – bjarven Mar 13 '15 at 10:21