I have tried to get this code to work by fixing things like missing quotes and parenthesis, but I am having no luck. Is someone available to help me with this? I am learning groovy script, so I am probably making a novice mistake, but it would be nice for you to at least post working code if you are offering it.
I believe this line is missing a quote and parenthesis.
@Denys Digtiar: Pipeline documentation says that keepLog is not writable for any builds but currentBuild, is there another way to modify that field for older builds in Pipeline? For example, is it possible to do the “Execute system Groovy script” method in a Jenkinsfile?
Comments
6 comments
I have tried to get this code to work by fixing things like missing quotes and parenthesis, but I am having no luck. Is someone available to help me with this? I am learning groovy script, so I am probably making a novice mistake, but it would be nice for you to at least post working code if you are offering it.
I believe this line is missing a quote and parenthesis.
Curious if there is a way to automatically unmark jenkins builds that are marked as "Keep this build forever" ?
Marlene: You are right about the missing syntax. Let us review the article.
Pendridheeraj: `keepLog` method accepts a `boolean`. If you want to unmark a build pass it `false` instead or `true`.
@Denys Digtiar: That makes sense..! Thanks a lot for the quick response :)
@Denys Digtiar: Pipeline documentation says that keepLog is not writable for any builds but currentBuild, is there another way to modify that field for older builds in Pipeline? For example, is it possible to do the “Execute system Groovy script” method in a Jenkinsfile?
@Yingkit Yingkit: use a script block in your declarative step to execute non-declarative syntax.
Also, I am curious if you ever found a way to un-set an older build as keepForever.
https://jenkins.io/doc/book/pipeline/syntax/#script
Please sign in to leave a comment.