I have a gitlab runner that is on a server needing a proxy to access external sites.
In my systemd setting, I have:
[Service]
Environment="HTTP_PROXY=http://squidproxy.example.com:3128/"
Environment="HTTPS_PROXY=http://squidproxy.example.com:3128/"
Environment="NO_PROXY=gitlab.example.com"
But I still can’t access pip. I receive this in the build log
WARNING: Retrying (Retry(total=1, connect=None, read=None,
redirect=None, status=None)) after connection broken by
‘NewConnectionError(‘<pip._vendor.urllib3.connection.HTTPSConnection
object at 0x7f10bd297880>: Failed to establish a new connection:
[Errno 111] Connection refused’)’: /simple/virtualenv/
I am believe my proxy isn’t used in the builds.
2
Answers
Your proxy won't be used in the builds unless you add the proxy to docker containers
In your config.toml for your runners add:
If you needed a proxy to reach your gitlab server you would have a config like this:
In the job that requires an internet connection set these variables:
Or even set them on the top-level if you want all jobs to have them per default.
Reference: https://docs.gitlab.com/ee/ci/yaml/#variables