Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19696

URL Trigger Plugin: Allow to save captured value in environment variable

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • urltrigger-plugin
    • None

      As in JENKINS-15843, I am using the URL Trigger to monitor the last successful build number of a job on another Jenkins server, but I also need to know the number of the newest successful build. I currently use the URL Trigger to watch either the full content of the buildNumber page (http://JENKINS/job/JOB/lastSuccessfulBuild/buildNumber) though it could just as easily be JSON path "number" on http://JENKINS/job/JOB/lastSuccessfulBuild/api/json

      After this job is triggered, I have a script to scrape the number into an environment variable:

      TRIGGER_BUILD_NUMBER=$(curl http://JENKINS/job/JOB/lastSuccessfulBuild/buildNumber)
      

      On Linux this is easy, but on Windows it is significantly more difficult. Also, to use it outside of the shell (i.e. send to downstream builds, in an email, etc.), I then have to write this value out to a file and load with EnvInject. It would be really nice if I could have the option to save the retrieved value from URL trigger as an environment variable that I could use in the rest of the build process

            gbois Gregory Boissinot
            mrtgold Tim Golding
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: