Quantcast

Proper method of saving output from a plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Proper method of saving output from a plugin

Christian McHugh
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!

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/fbc184ff-8138-488e-a1c0-40a06f16a3dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Proper method of saving output from a plugin

Daniel Beck

> On 20.04.2017, at 08:04, Christian McHugh <[hidden email]> 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?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/97FE46C4-8A34-422E-8A90-45874799881C%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Proper method of saving output from a plugin

Ted Xiao
In reply to this post by Christian McHugh
you can also extend InvisibleAction and add it to the build

Run.addAction
Run.getAction


On Thursday, April 20, 2017 at 2:04:03 PM UTC+8, Christian McHugh wrote:
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 <a href="https://github.com/jenkinsci/saltstack-plugin/issues/78" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fsaltstack-plugin%2Fissues%2F78\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG0Cc_UeHi62awNew5TxuLaNW8nXQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fsaltstack-plugin%2Fissues%2F78\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG0Cc_UeHi62awNew5TxuLaNW8nXQ&#39;;return true;">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 <a href="https://groups.google.com/forum/#!searchin/jenkinsci-dev/EnvironmentContributingAction%7Csort:relevance/jenkinsci-dev/TLUKZKOwJSQ/kzPUy5EiFkwJ" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/forum/#!searchin/jenkinsci-dev/EnvironmentContributingAction%7Csort:relevance/jenkinsci-dev/TLUKZKOwJSQ/kzPUy5EiFkwJ&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/forum/#!searchin/jenkinsci-dev/EnvironmentContributingAction%7Csort:relevance/jenkinsci-dev/TLUKZKOwJSQ/kzPUy5EiFkwJ&#39;;return true;">here, however the EnvironmentContributingAction appears to eventually shell out, resulting in the mentioned error when passed a large chunk of data.


Thanks!

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/21e68a7b-e5c3-4d8b-9f2b-9bd81d82914b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Proper method of saving output from a plugin

Christian McHugh
In reply to this post by Christian McHugh
To close this out, went with the write a file solution.

Thanks all

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/4f219927-fca3-4f3a-a6fa-8a3ab52030af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...