Re: Pipeline Build Wrapper

2017-07-01 Thread Ɓukasz Zachulski
Hello, 

@Steven I'm looking for something which would impose limit to log files as well.

Would you mind sharing your work so I could test your Plugin? 

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/75272edf-c63d-40d2-9b1f-230e53d87e3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-30 Thread Robert Sandell
https://jenkins.io/doc/developer/extensions/jenkins-core/#globalconfiguration
http://javadoc.jenkins.io/jenkins/model/GlobalConfiguration.html

/B

2017-06-30 11:00 GMT+02:00 Steven F :

>
>
> On Wednesday, June 28, 2017 at 3:39:20 PM UTC+1, Jesse Glick wrote:
>>
>> cf. JENKINS-28822
>>
>
>  Sorry for another basic question, but do you have the name of a class I
> should look into to add a global configuration (from Manage Jenkins) that
> would be accessible to my RunListener? I've used Descriptors with other
> extension points but it doesn't seem to apply here since there is only one
> instance. I've also looked into OptionalJobProperty but that wouldn't be on
> a global level.
>
> --
> 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 jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-dev/cb4724c6-1138-4739-94e5-cd245573fd60%
> 40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Robert Sandell
*Software Engineer*
*CloudBees Inc.*

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS3XASJbF19vZg_XFVq1p%3D_VCgewsC6qfifcOND4Ec_COw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-30 Thread Robert Sandell
https://jenkins.io/doc/developer/extensions/jenkins-core/#globalconfiguration
http://javadoc.jenkins.io/jenkins/model/GlobalConfiguration.html

/B

2017-06-30 11:00 GMT+02:00 Steven F :

>
>
> On Wednesday, June 28, 2017 at 3:39:20 PM UTC+1, Jesse Glick wrote:
>>
>> cf. JENKINS-28822
>>
>
>  Sorry for another basic question, but do you have the name of a class I
> should look into to add a global configuration (from Manage Jenkins) that
> would be accessible to my RunListener? I've used Descriptors with other
> extension points but it doesn't seem to apply here since there is only one
> instance. I've also looked into OptionalJobProperty but that wouldn't be on
> a global level.
>
> --
> 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 jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-dev/cb4724c6-1138-4739-94e5-cd245573fd60%
> 40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Robert Sandell
*Software Engineer*
*CloudBees Inc.*

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS2UBVHhQFLO7HWGrfd3kdWEW-9QWCwJM_Uht%3DA5Gs%2BYsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-30 Thread Steven F


On Wednesday, June 28, 2017 at 3:39:20 PM UTC+1, Jesse Glick wrote:
>
> cf. JENKINS-28822 
>

 Sorry for another basic question, but do you have the name of a class I 
should look into to add a global configuration (from Manage Jenkins) that 
would be accessible to my RunListener? I've used Descriptors with other 
extension points but it doesn't seem to apply here since there is only one 
instance. I've also looked into OptionalJobProperty but that wouldn't be on 
a global level.

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/cb4724c6-1138-4739-94e5-cd245573fd60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-28 Thread Jesse Glick
On Tue, Jun 27, 2017 at 6:36 AM, Steven F  wrote:
> if it's in the middle of a shell script the build will always be
> marked Failure because of the error caused by interrupting the shell script.

cf. JENKINS-28822

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2Wy5at7wp3Syu7kQWFU%2BAy7gEdPdswr9P4iqvZBLURaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-27 Thread Steven F
On Monday, June 26, 2017 at 11:17:28 PM UTC+1, Jesse Glick wrote:
>
> On Mon, Jun 26, 2017 at 5:50 PM, Steven F  > wrote: 
> > That improvement would help but sometimes a flaw in the 
> > build can result in massive log file, even filling the drive. 
>
> So the simplest thing that could work is to just have a `RunListener` 
> which starts checking the length of the `logText` and after some 
> threshold will `Executor.interrupt` it. 
>

This worked a lot better now that I understand more what's going on, thanks 
for the help.

There is a minor issue though where the result passed to Executor.interrupt 
is being overridden by whatever happens in the pipeline to interrupt it.
e.g., if it's in the middle of a shell script the build will always be 
marked Failure because of the error caused by interrupting the shell script.
In my case I don't mind because I wanted to mark it failed anyway, but I 
don't know if other results will come up in other cases.

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/4b582dc9-46d4-4d06-a3f2-31f544d76fce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-26 Thread Jesse Glick
On Mon, Jun 26, 2017 at 5:50 PM, Steven F  wrote:
> That improvement would help but sometimes a flaw in the
> build can result in massive log file, even filling the drive.

So the simplest thing that could work is to just have a `RunListener`
which starts checking the length of the `logText` and after some
threshold will `Executor.interrupt` it.

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2C_J1%2Bk70aF%3D5Vc61-T4SrEe1AOa%3Du%3DsUzMAjNR3VxBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-26 Thread Steven F
On Monday, June 26, 2017 at 10:35:10 PM UTC+1, Jesse Glick wrote:
>
> On Mon, Jun 26, 2017 at 5:25 PM, Steven F  > wrote: 
> > It's just to fail a build once 
> > the build log file size is over a certain threshold. 
>
> For performance reasons? Cf. JENKINS-38381. 
>

Partially, yes. That improvement would help but sometimes a flaw in the 
build can result in massive log file, even filling the drive. A way to 
impose a limit as a rule is what I'm after. I'm also taking this as a 
learning opportunity to explore the different components of Jenkins :)

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/79b8e558-b8b8-4f8e-90e2-91369f22a4fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-26 Thread Jesse Glick
On Mon, Jun 26, 2017 at 5:25 PM, Steven F  wrote:
> It's just to fail a build once
> the build log file size is over a certain threshold.

For performance reasons? Cf. JENKINS-38381.

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0ZYS9JwBGZc_jgpBXQ3gARSWs5nh2mGO_vBB-UWByc_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-26 Thread Steven F
On Monday, June 26, 2017 at 8:29:02 PM UTC+1, Jesse Glick wrote:
>
> On Mon, Jun 26, 2017 at 11:18 AM, Steven F  > wrote: 
> > I'd like a 
> > parameter on the build config page 
>
> Possible, via the `FlowDefinition` extension point, but probably not 
> what you actually want, since this will not work with multibranch 
> Pipelines. 
>
> I suppose the most generic solution would be a `RunListener` that 
> aborts a build after some time. This has some clear problems in 
> relation to Pipeline, such as (arguably improperly) aborting a build 
> which is just sitting in `input` and harming no one. Depends on what 
> you are trying to accomplish. 
>

Hmm, interesting. I briefly tried with the RunListener approach but the 
interruption of the build didn't seem quite right. It wasn't taking on the 
Result that I passed, but it did interrupt, so I thought it might cause 
unseen issues. Also, I wasn't sure how to clean up the scheduled task that 
I was starting.

I'll have another look at RunListener though. It's just to fail a build 
once the build log file size is over a certain threshold.

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/02937201-a669-4d7f-957d-e889adcdc9d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline Build Wrapper

2017-06-26 Thread Jesse Glick
On Mon, Jun 26, 2017 at 11:18 AM, Steven F  wrote:
> I'd like a
> parameter on the build config page

Possible, via the `FlowDefinition` extension point, but probably not
what you actually want, since this will not work with multibranch
Pipelines.

I suppose the most generic solution would be a `RunListener` that
aborts a build after some time. This has some clear problems in
relation to Pipeline, such as (arguably improperly) aborting a build
which is just sitting in `input` and harming no one. Depends on what
you are trying to accomplish.

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0oXScnCJvEVKfdB9mDP_Wqp5%2Bnzo_-%3DGC%3D8GA%3DmByyag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.