Configure gradle proxies for trusted runners only
We had previously been running all of our datahub builds on trusted runners, which required the proxies to be set manually.
However, this configuration was not supposed to have worked; trusted runners are only supposed to run on the protected branches, whereas feature branch should run on the shared runners which do not work if proxy options are set.
Unfortunately, gradle does not use the $HTTP_PROXY
, $HTTPS_PROXY
and $NO_PROXY
environment variables that are automatically for trusted runners. Neither does the option -Djava.net.useSystemProxies=true
work in the GitLab-CI context.
Therefore, this commit is required in order to configure gradle with proxies only if they are already set in the environment.
Bug: T348738