Jenkins artifact short URL / pretty url

574 Views Asked by At

How to get a direct short URL for the jenkins build output file.

My last successful build is located at this path.

https://jenkins.domain.com/job/Org_repo_folder/job/project/job/release/build_number/artifact/ApplicationModule/build/outputs/apk/release/AppName_version.apk

How do I access the file with a short URL or path?

Use case:

  1. Long url exposes the build path.
  2. Emails with long urls ends at spam folder.
  3. Build sharing with simple URLs
1

There are 1 best solutions below

5
On BEST ANSWER

If you're looking for a Jenkins-internal solution, then you could use the userContent feature.

E.g., Jenkins serves data under $JENKINS_HOME/userContent/file.apk under the URL $JENKINS_URL/userContent/file.apk.

If you copy (or symlink) the data that you want to provide to $JENKINS_HOME/userContent/, then you can use the userContent URL as a short URL for that.