jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-32982] cross-build state

Open
#398 3 comments 0 reactions 0 assignees View on GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
73
Forks
129
PR merge metrics
No merged PRs in 30d

Description

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')

---
Originally reported by jglick, imported from: cross-build state


  • assignee: jglick
  • status: Open
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 6
  • imported: 20251215-220547

Raw content of original issue

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')


Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.