Search code examples
jenkinsgetversionlts

How to query the current Jenkins LTS version number?


How to get programatically the version number designated as the current LTS release of Jenkins, one of a list of weekly release numbers?

The Jenkins download page has text to indicate the current version designated as LTS (e.g., 2.46.2). To download the current Jenkins LTS release binary for Ubuntu, there are two choices:

  • distro-specific packages, which contain the version in their name so as to not be ambiguous.
  • generic war file, which does not contain version number to permit a constant download target that presumably is guaranteed to link to the current version as it changes over time.

I am looking for a means of programatically getting the version number, so that it can be used to:

  • Check the current version to detect updates
  • Describe the generic war file
  • Complete a file name to retrieve that contains the version number

I am hoping there is a single file that contains the authoritative version value somewhere on the Jenkins.io site, that can be queried via cURL or some such.


Solution

  • The jenkins update center [1] provides the latest release numbers

    So, a simple curl -Ls https://updates.jenkins.io/stable/latestCore.txt should do the trick of retrieving the latest LTS version number.

    [1] https://updates.jenkins.io/