2

I have a job that uses the Copy Artifacts Plugin to upload a .ipa file to TestFlight. I would like to only run this job by hand, not trigger it automatically. The job is configured with a build-selector parameter so that I can start the upload from one of a handful of similar jobs.

Is there an easy way (possibly with a plugin or script) to get the URL to the specific job that provided the artifact being uploaded?

Essentially I want to take the $BUILD_URL value from the upstream job so that I can include it in the TestFlight build notes.

(I am not sure if it directly pertains to what I want, but Get Jenkins upstream jobs seems to suggest that Groovy scripting might be the way to go. I also found a post on the Jenkins forums, http://jenkins-ci.361315.n4.nabble.com/Getting-upstream-job-s-build-number-td3167291.html that looked promising, but does not seem to apply to my scenario of manually triggered builds.)

Community
  • 1
  • 1
amacleod
  • 1,450
  • 2
  • 15
  • 23

1 Answers1

0

Unless you are "Triggering Parameterized build..." a downstream job, in which case you could pass along Predefined Parameters "UPSTREAM_BUILD_URL=$BUILD_URL", I think you would have to store the BUILD_URL with the artifacts.

mmacvicar
  • 761
  • 6
  • 9
  • Unfortunately, I want to "pull" the information from the selected job, rather than "pushing" information via triggered builds. Storing the information as an artifact might work, like in a little `.txt` file or YAML or something, though. – amacleod Mar 28 '17 at 18:02
  • The Jenkins API does store "upstreamUrl" and "upstreamBuild" for a job. Perhaps you could use that? – mmacvicar Apr 14 '17 at 23:12