Search code examples
jenkinsurlbuildartifactbitly

Jenkins artifact short URL / pretty url


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

Solution

  • 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.