Proper method of saving output from a plugin

17 views
Skip to first unread message

Christian McHugh

unread,
Apr 20, 2017, 2:04:03 AM4/20/17
to Jenkins Developers
Greetings,

The saltstack plugin sends a message to the saltapi, and returns the response to the Jenkins console. With the introduction of scripted pipelines, it is now possible to return the result into a groovy variable for further processing. For older freestyle jobs however, that is not an option, so the plugin currently allows for saving the saltapi output as an environment variable to again allow for further processing in subsequent shell steps.

However there is a problem if the saltapi returns are large amount of data, which results in an error when attempting to save it into an environment variable. What are the recommendations for supporting large environment variables? Currently this process is implemented as discussed here, however the EnvironmentContributingAction appears to eventually shell out, resulting in the mentioned error when passed a large chunk of data.


Thanks!

Daniel Beck

unread,
Apr 20, 2017, 3:17:25 AM4/20/17
to jenkin...@googlegroups.com

> On 20.04.2017, at 08:04, Christian McHugh <christia...@gmail.com> wrote:
>
> For older freestyle jobs however, that is not an option, so the plugin currently allows for saving the saltapi output as an environment variable to again allow for further processing in subsequent shell steps.

Why not write to a file instead?

Ted Xiao

unread,
Apr 24, 2017, 1:26:20 AM4/24/17
to Jenkins Developers
you can also extend InvisibleAction and add it to the build

Run.addAction
Run.getAction

Christian McHugh

unread,
Apr 28, 2017, 4:05:17 AM4/28/17
to Jenkins Developers
To close this out, went with the write a file solution.

Thanks all
Reply all
Reply to author
Forward
0 new messages