Hustoles
Hustoles

Reputation: 53

Jenkins pipeline: propagate "keep this build forever" to downstream jobs

Is there some option to propagate "keep this build forever" to jobs started by pipeline which I want to keep forever?

Now, this button works only on single job/pipeline. But if I need to keep the pipeline with its job I need to go every single job started by this pipeline and click on "keep this build forever"

Thanks for any suggestion.

Upvotes: 1

Views: 3958

Answers (2)

Tobias Tschech
Tobias Tschech

Reputation: 61

to clear this in the meantime the functionality has been added and you don't need to use rawBuild:

currentBuild.setKeepLog(true)

Upvotes: 5

Holi
Holi

Reputation: 384

Found it! If used from within a pipeline, it is enough to write 'currentBuild.rawBuild.keepLog(true)'

Upvotes: 1

Related Questions