Issue
How to get a direct short URL for the jenkins build output file.
My last successful build is located at this path.
href="https://jenkins.domain.com/job/Org_repo_folder/job/project/job/release/build_number/artifact/ApplicationModule/build/outputs/apk/release/AppName_version.apk" rel="nofollow noreferrer">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:
- Long url exposes the build path.
- Emails with long urls ends at spam folder.
- 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.
Answered By - Alex O
Answer Checked By - Terry (JavaFixing Volunteer)