Closed Kamilcuk closed 1 year ago
jenkins.getRootUrl()
can be empty. The tunnel host is not necessarily the same as new URL(jenkins.getRootUrl()).getHost()
and the port could also be anything (e.g. Jenkins runs behind a load balancer, reverse proxy, etc.).
What is your use case? Is CaaS not an option?
If you are running Jenkins in Nomad, dynamically placing the instance (and the port it's listening to) then it would help to have the ${NOMAD_ADDR_http}
(or whatever the port is named) available in the template. Environment variables visible to the Jenkins host are not currently available to the template.
I'm using CaaS and several other "Jenkins consistent configuration as code" plugins.
What feature do you want to see added?
Please add two new template parameters:
%JENKINS_URL%
and%JENKINS_TUNNEL%
that will be replaced byjenkins.getRootUrl()
and bynew URL(jenkins.getRootUrl()).getHost() + ":50000"
respectively.Jenkins already knows the URL, there is no need to fill it manually. This would enhance portability of templates between our multiple Jenkins instances.
Upstream changes
No response