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

Add ability to determine the gerrit event which triggers a job

XMLWordPrintable

      Upgrading from using only the 'gerrit-trigger-plugin' I lose the ability to determine which gerrit event triggered the job.

      I need this information to decide which type of pipeline to run (build packages when changes are opened, promote packages when they successfully pass the verification and review stage):

      if (env.GERRIT_EVENT_TYPE == "patchset-created") {
          runBuild()
      }
      else if (env.GERRIT_EVENT_TYPE == "change-merged"){
          runPromote()
      }
      

      At least this environmental variable is not in the list of supported env vars... If there is any other way to get this information that I might have missed then please let me know! 

       

      [update: maybe the 'change-merged' event won't work for my use case since the job is automatically closed when the change is closed.  Instead I think JENKINS-60365 might better suit my needs]

            lucamilanesio Luca Domenico Milanesio
            jess Gordon Jess
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: