yes. You can generate groovy code using any tool you want and then use load
to import it, e.g.
node('docker') {
checkout scm
// this step generates Jenkinsfile.do_merge
sh script: './bin/git/needs_merging -j'
pipeline = load 'Jenkinsfile.do_merge'
pipeline.execute()
}
and the generated code looks like
$ cat Jenkinsfile.do_merge
// Jenkins job definition for the daily-merge job.
//
// GENERATED by needs_merging
//
// DO NOT EDIT
//
def execute() {
/// your code goes here
}
return this
On Sunday, August 18, 2019 at 3:31:17 PM UTC-4, Yeikel Santana wrote:
>
> Dear Jenkins Community,
>
> I am aware that we can generate dynamic stages using groovy scripts.
> Question is, can we also do this from the standard output of a script?
>
> For example, I have a script written in Nodejs that I execute with "sh
> node script.js" and that It can produce standard output to the console.I
> would like to use its outputs to generate new stages . Is this possible? Do
> I need to parse the output from groovy in order to do something like this?
>
> I would like to avoid rewriting this script to groovy as much as possible.
>
> Thank you!
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/5a64dba0-5cb1-4fef-bcf0-0fbe9325cc39%40googlegroups.com.