Hi all,
I am automatically downloading Jenkins plugins into an air gapped environment. That worked pretty good over the last years. Because of regulatory reasons I am no longer allowed to download plugins from a one or more mirror servers (aka block list).
So my two questions are:
- From which alternative location should I download the plugin?
- And how can I determine the location automatically?
What I tried until now:
- I know the
...plugins/git/5.2.2/git.hpi?mirrorlist
trick but that only provides an HTML page and we all know parsing HTML for links is more than unpleasant. - I tried to
curl
the plugin URL with a properAccept: application/json
header as can be seen in the mirrorbits source but it too returns only HTML. - URLs like
pkg.jenkins.io/plugins/git/5.2.2/git.hpi
orjenkins.io/plugins/git/5.2.2/git.hpi
do not work
What will not work for me:
- parsing HTML because it depends on HTML URL location knowledge and is too brittle for the future
- browsing the HTML page by hand and copying the URL
What I hope for:
- a static URL to fall back to (bypassing mirrors at all)
- a JSON result from which I can select the next mirror (choose a different mirror)
For your understanding, my workflow looks like this:
- load next plugin metadata from the official update center JSON => url and so on
- GET
https://get.jenkins.io/plugins/${plugin}/${version}/${plugin}.hpi
- analyze response
- if response Code is 302 and Location is not in ${UrlBlockList}: yay
- else: download from original source or other mirror (HELP)
Please note: Doing a full mirror is out of the question.
Thanks and cheers