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

cross-build state

XMLWordPrintable

      Sometimes it is desirable for a Pipeline script to save and retrieve some state (data) which is persisted across builds.

      Possibly could be supported using a plugin which defined a Map-valued global variable made accessible to every Pipeline script which would serialize any values you set to it to a per-job location. (Could even have a variable which held per-master state, though you then need to be careful about access control policies.)

      As a workaround, for non-sandboxed jobs, you could use java.io.File calls to read/write a file on the Jenkins master. For example

      File f = new File(currentBuild.rawBuild.parent.rootDir, 'my-state')
      

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: