Extending email-ext plugin

2012-11-16 Thread AdvanTiSS
I've found out that email-ext plugin core has very powerfull framework and 
allows to stup flexible notification rules. So, what about make some code 
refactorings to enable creation child publisher plugins supportig another 
IM protocols.
I know about [instant-messaging] and used it for implemeting skype plugin 
(skypekit version), but in comparison with email-ext [instant-messaging] 
looks ugly.



Re: Can anoyone help determine the cause of a Jenkins crash.

2012-11-16 Thread AdvanTiSS
-Xmx default walue for windows service installer is 256mb and we had same 
problem until heap max size was increased to 4gb

On Thursday, November 15, 2012 11:20:03 PM UTC+2, SA Evans wrote:
>
> What do you have for your java memory settings?  Primarily -Xmx would 
> define the max amount of memory your main java process can allocate.
>
> Scott
>
> On Thu, Nov 15, 2012 at 3:10 PM, MDKF  >wrote:
>
>> Can anyone help with this issue?
>>
>> On Monday, November 12, 2012 10:36:13 AM UTC-5, MDKF wrote:
>>>
>>> Hi All,
>>>  My Jenkins server died last night. I found the following text in the 
>>> error log. Can anyone help me decipher what happened? Ive had these out of 
>>> memory exceptions before.
>>>
>>>
>>> Nov 11, 2012 12:39:50 AM winstone.Logger logInternal
>>> SEVERE: Error while serving http://nwd2hscjnks/job/**
>>> VectorGenerator/api/xml 
>>> java.lang.reflect.**InvocationTargetException
>>> at sun.reflect.**GeneratedMethodAccessor106.**invoke(Unknown Source)
>>> at sun.reflect.**DelegatingMethodAccessorImpl.**invoke(Unknown 
>>> Source)
>>> at java.lang.reflect.Method.**invoke(Unknown Source)
>>> at org.kohsuke.stapler.Function$**InstanceFunction.invoke(**
>>> Function.java:288)
>>> at org.kohsuke.stapler.Function.**bindAndInvoke(Function.java:**151)
>>> at org.kohsuke.stapler.Function.**bindAndInvokeAndServeResponse(**
>>> Function.java:90)
>>> at org.kohsuke.stapler.MetaClass$**1.doDispatch(MetaClass.java:**
>>> 111)
>>> at org.kohsuke.stapler.**NameBasedDispatcher.dispatch(**
>>> NameBasedDispatcher.java:53)
>>> at org.kohsuke.stapler.Stapler.**tryInvoke(Stapler.java:574)
>>> at org.kohsuke.stapler.Stapler.**invoke(Stapler.java:659)
>>> at org.kohsuke.stapler.MetaClass$**4.doDispatch(MetaClass.java:**
>>> 203)
>>> at org.kohsuke.stapler.**NameBasedDispatcher.dispatch(**
>>> NameBasedDispatcher.java:53)
>>> at org.kohsuke.stapler.Stapler.**tryInvoke(Stapler.java:574)
>>> at org.kohsuke.stapler.Stapler.**invoke(Stapler.java:659)
>>> at org.kohsuke.stapler.MetaClass$**6.doDispatch(MetaClass.java:**
>>> 241)
>>> at org.kohsuke.stapler.**NameBasedDispatcher.dispatch(**
>>> NameBasedDispatcher.java:53)
>>> at org.kohsuke.stapler.Stapler.**tryInvoke(Stapler.java:574)
>>> at org.kohsuke.stapler.Stapler.**invoke(Stapler.java:659)
>>> at org.kohsuke.stapler.Stapler.**invoke(Stapler.java:488)
>>> at org.kohsuke.stapler.Stapler.**service(Stapler.java:162)
>>> at javax.servlet.http.**HttpServlet.service(**HttpServlet.java:45)
>>> at winstone.ServletConfiguration.**execute(ServletConfiguration.**
>>> java:248)
>>> at winstone.RequestDispatcher.**forward(RequestDispatcher.**
>>> java:333)
>>> at winstone.RequestDispatcher.**doFilter(RequestDispatcher.**
>>> java:376)
>>> at hudson.util.**PluginServletFilter$1.**
>>> doFilter(PluginServletFilter.**java:95)
>>> at hudson.util.**PluginServletFilter.doFilter(**
>>> PluginServletFilter.java:87)
>>> at winstone.FilterConfiguration.**execute(FilterConfiguration.**
>>> java:194)
>>> at winstone.RequestDispatcher.**doFilter(RequestDispatcher.**
>>> java:366)
>>> at hudson.security.csrf.**CrumbFilter.doFilter(**
>>> CrumbFilter.java:47)
>>> at winstone.FilterConfiguration.**execute(FilterConfiguration.**
>>> java:194)
>>> at winstone.RequestDispatcher.**doFilter(RequestDispatcher.**
>>> java:366)
>>> at hudson.security.**ChainedServletFilter$1.**
>>> doFilter(ChainedServletFilter.**java:84)
>>> at hudson.security.**UnwrapSecurityExceptionFilter.**doFilter(**
>>> UnwrapSecurityExceptionFilter.**java:51)
>>> at hudson.security.**ChainedServletFilter$1.**
>>> doFilter(ChainedServletFilter.**java:87)
>>> at org.acegisecurity.ui.**ExceptionTranslationFilter.**doFilter(**
>>> ExceptionTranslationFilter.**java:166)
>>> at hudson.security.**ChainedServletFilter$1.**
>>> doFilter(ChainedServletFilter.**java:87)
>>> at org.acegisecurity.providers.**anonymous.**
>>> AnonymousProcessingFilter.**doFilter(**AnonymousProcessingFilter.**
>>> java:125)
>>> at hudson.security.**ChainedServletFilter$1.**
>>> doFilter(ChainedServletFilter.**java:87)
>>> at org.acegisecurity.ui.**rememberme.**RememberMeProcessingFilter.**
>>> doFilter(**RememberMeProcessingFilter.**java:142)
>>> at hudson.security.**ChainedServletFilter$1.**
>>> doFilter(ChainedServletFilter.**java:87)
>>> at org.acegisecurity.ui.**AbstractProcessingFilter.**doFilter(**
>>> AbstractProcessingFilter.java:**271)
>>> at hudson.security.**ChainedServletFilter$1.**
>>> doFilter(ChainedServletFilter.**java:87)
>>> at org.acegisecurity.ui.**basicauth.**BasicProcessingFilter.**
>>> doFilter(**BasicProcessingFilter.java:**173)
>>> at hudson.security.**ChainedServletFilter$1.**
>>> doFilter(ChainedServletFilter.**java:87)
>>> at jenkins.security.**ApiTokenFilter.doFilter(**
>>> ApiTokenFilter.java:63)
>>> at 

Re: Exception while using groovy-html.template in editable eamil notification

2012-11-15 Thread AdvanTiSS
You should declare imports for referenced classes 

On Thursday, November 15, 2012 1:03:47 PM UTC+2, Sven Finsterwalder wrote:
>
> Hi all,
>
> i try to send an email and i got that error:
>
> Nov 15, 2012 11:59:38 AM hudson.plugins.emailext.plugins.content.ScriptContent
> SEVERE: null
> javax.script.ScriptException: javax.script.ScriptException: 
> groovy.lang.MissingPropertyException: No such property: Jenkins for class: 
> SimpleTemplateScript5
>   at 
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:117)
>   at 
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:103)
>   at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
>   at 
> hudson.plugins.emailext.plugins.content.ScriptContent.renderContent(ScriptContent.java:163)
>   at 
> hudson.plugins.emailext.plugins.content.ScriptContent.getContent(ScriptContent.java:121)
>   at 
> hudson.plugins.emailext.plugins.ContentBuilder.replaceTokensWithContent(ContentBuilder.java:115)
>   at 
> hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:88)
>   at 
> hudson.plugins.emailext.ExtendedEmailPublisher.getContent(ExtendedEmailPublisher.java:540)
>   at 
> hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:363)
>   at 
> hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:273)
>   at 
> hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:265)
>   at 
> hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:225)
>   at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:779)
>   at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
>   at hudson.model.Run.execute(Run.java:1560)
>   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
>   at hudson.model.ResourceController.execute(ResourceController.java:88)
>   at hudson.model.Executor.run(Executor.java:236)
> Caused by: javax.script.ScriptException: 
> groovy.lang.MissingPropertyException: No such property: Jenkins for class: 
> SimpleTemplateScript5
>   at 
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:318)
>   at 
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:111)
>   ... 19 more
> Caused by: groovy.lang.MissingPropertyException: No such property: Jenkins 
> for class: SimpleTemplateScript5
>   at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
>   at 
> org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
>   at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
>   at SimpleTemplateScript5.run(SimpleTemplateScript5.groovy:223)
>   at 
> groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:165)
>   at 
> groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:177)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:601)
>   at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:230)
>   at 
> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
>   at 
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
>   at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
>   at 
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
>   at Script5.run(Script5.groovy:12)
>   at 
> org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:315)
>   ... 20 more
>
>
> Nov 15, 2012 11:59:38 AM hudson.plugins.emailext.plugins.content.ScriptContent
> SEVERE: Exception on init file: java.io.FileNotFoundException: 
> /home/hudson/email-templates/groovy/init.groovy (No such file or directory)
>
> Nov 15, 2012 11:59:38 AM hudson.model.Run
> INFO: dploytest #5 main build action completed: SUCCESS
>
>
> How can i resolve that problem? And where i can find the init.groovy script?
>
>
>

Re: Eamil-ext plugin add text to msg

2012-11-14 Thread AdvanTiSS
You mean TokenMacro inline groovy script?

On Wednesday, November 14, 2012 2:22:13 PM UTC+2, slide wrote:
>
> Just put it into the content template, why do it through a pre-send 
> script? The templates are very powerful.
>
> Sent from my Windows Phone
> --
> From: Sven Finsterwalder
> Sent: 11/14/2012 4:35 AM
> To: jenkins...@googlegroups.com 
> Subject: Re: Eamil-ext plugin add text to msg
>
> Yes that works...
> How can i add now this two vaulue to that email:
> ${BUILD_URL}
> 
> ${BUILD_LOG, maxLines=250, escapeHtml=true}
>
> Can i add this also in the pre-send Script area?
>
>
> Am Mittwoch, 14. November 2012 11:43:32 UTC+1 schrieb slide:
>>
>> Have you tried with something more simple, like just calling .setText 
>> with some random content?
>>
>>
>> On Wed, Nov 14, 2012 at 12:32 AM, Sven Finsterwalder wrote:
>>
>>> Ok here it is:
>>> That code is the pre-send script area:
>>>
>>> def deploymentJob = 
>>> Jenkins.getInstance().getItemByFullName("deployment-universal")
>>> def colorDeployment = deploymentJob.getIconColor()
>>> def testJob = 
>>> Jenkins.getInstance().getItemByFullName("selenium2-portalservices-Smoketests-windows-Chrome-2.2")
>>> def colorTestJob = testJob.getIconColor()
>>>  
>>> if(colorDeployment == hudson.model.BallColor.BLUE && colorTestJob != 
>>> hudson.model.BallColor.BLUE){
>>>
>>>def lastbuild = testJob.getLastBuild()   
>>>def build = testJob.getBuildByNumber(lastbuild.getNumber())
>>>def logFilePath = build.getLogFile().getPath()  
>>>String logContent = new File(logFilePath).text
>>>
>>>def i = logContent.indexOf("Running TestSuite")  
>>>def size = logContent.size()
>>>def selOutput = logContent.substring(i,size)
>>>  
>>>logger.log(selOutput)
>>>msg.setText(selOutput)
>>> }
>>>
>>>
>>> Am Dienstag, 13. November 2012 16:14:13 UTC+1 schrieb slide:

 Please show your code.


 On Tue, Nov 13, 2012 at 8:01 AM, Sven Finsterwalder 
 wrote:

> Hi,
>
> how can add text to the email that will be send.
>
>> msg - the MimeMessage object which can be modified
>
> I try it with the pre-send script, but it does not work :-(
> Please give me an example code line.
>
> Thanks
>



 -- 
 Website: http://earl-of-code.**com 
  
>>>
>>
>>
>> -- 
>> Website: http://earl-of-code.com
>>  
>

Re: Eamil-ext plugin add text to msg

2012-11-14 Thread AdvanTiSS
1) I suggest to check [deploymentJob.getLastCompletedBuild().getResult()] 
value instead of [deploymentJob.getIconColor()]
2) Does [selOutput] evaluated properly when running script in jenkins sript 
console? 

On Wednesday, November 14, 2012 9:32:51 AM UTC+2, Sven Finsterwalder wrote:
>
> Ok here it is:
> That code is the pre-send script area:
>
> def deploymentJob = 
> Jenkins.getInstance().getItemByFullName("deployment-universal")
> def colorDeployment = deploymentJob.getIconColor()
> def testJob = 
> Jenkins.getInstance().getItemByFullName("selenium2-portalservices-Smoketests-windows-Chrome-2.2")
> def colorTestJob = testJob.getIconColor()
>  
> if(colorDeployment == hudson.model.BallColor.BLUE && colorTestJob != 
> hudson.model.BallColor.BLUE){
>
>def lastbuild = testJob.getLastBuild()   
>def build = testJob.getBuildByNumber(lastbuild.getNumber())
>def logFilePath = build.getLogFile().getPath()  
>String logContent = new File(logFilePath).text
>
>def i = logContent.indexOf("Running TestSuite")  
>def size = logContent.size()
>def selOutput = logContent.substring(i,size)
>  
>logger.log(selOutput)
>msg.setText(selOutput)
> }
>
>
> Am Dienstag, 13. November 2012 16:14:13 UTC+1 schrieb slide:
>>
>> Please show your code.
>>
>>
>> On Tue, Nov 13, 2012 at 8:01 AM, Sven Finsterwalder wrote:
>>
>>> Hi,
>>>
>>> how can add text to the email that will be send.
>>>
 msg - the MimeMessage object which can be modified
>>>
>>> I try it with the pre-send script, but it does not work :-(
>>> Please give me an example code line.
>>>
>>> Thanks
>>>
>>
>>
>>
>> -- 
>> Website: http://earl-of-code.com
>>  
>

Re: EnvInject Plugin can't read key

2012-11-14 Thread AdvanTiSS
Variable name must begin with an Alphanumeric character or underscore 
character (_), followed by one or more *Alphanumeric characters*. That 
means that the variable *name* cannot contain any special characters other 
than underscore.

On Wednesday, November 14, 2012 9:32:53 AM UTC+2, Olly wrote:
>
> Hi, 
> I try to read key/value pairs from a property file with the EnvInject 
> Plugin. It works. 
> But when I want to read a key like scp.test (with a point) I can't read it 
> with $scp.test. I have tryed a few combinations like ${scp.test} but 
> nothing 
> works. 
>
> Can somebody help me? 
>
>
> Thanks 
> Olly 
>
>
>
> -- 
> View this message in context: 
> http://jenkins.361315.n4.nabble.com/EnvInject-Plugin-can-t-read-key-tp4646071.html
>  
> Sent from the Jenkins users mailing list archive at Nabble.com. 
>


Re: How to get the result of the triggered job in one email

2012-11-12 Thread AdvanTiSS
"So that means with this plugin i can include the logoutput of the test 
job?"

Yes, you can, using pre-send groovy script obvously. 
https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin


On Monday, November 12, 2012 12:41:40 PM UTC+2, Sven Finsterwalder wrote:
>
> Promotion can include email-ext step where you can put anythig you want.
>>
> So that means with this plugin i can include the logoutput of the test 
> job? Can you show me an example (screenshot) of this,please?
>  
>
> Am Montag, 12. November 2012 10:16:57 UTC+1 schrieb AdvanTiSS:
>>
>> We have almost similar configuration:
>>
>> 1."Main Build" Job - triggered by SCM, make chekout, compiling code and 
>> unit-testing. Output file iz zip archive with application binaries which 
>> deployed into build - artifacts directory.
>> 2. "Functional Tests" Job - triggered from upstream "Main Build" job, 
>> takes as a parameter path to newly created deployment zip, make functional 
>> testing. 
>> 3. "Smoke Tests" Job - triggered from upstream "Main Build" job, takes as 
>> a parameter path to newly created deployment zip, make smoke testing.
>>
>> Also, "Main Build" job has configured "promouting builds" section, with 
>> promotion defined on downstream jobs completion. Promotion can include 
>> email-ext step where you can put anythig you want.
>>
>>
>> On Monday, November 12, 2012 8:53:40 AM UTC+2, Sven Finsterwalder wrote:
>>>
>>> We have one main-job that calls two other jobs with parameters.
>>> The first Job builds the product and the second job does some smoketests.
>>>
>>> The main-job now sends an email with the logoutput. My idea was to get 
>>> all logoutput in one log.
>>>
>>>
>>>

Re: How to get the result of the triggered job in one email

2012-11-12 Thread AdvanTiSS
We have almost similar configuration:

1."Main Build" Job - triggered by SCM, make chekout, compiling code and 
unit-testing. Output file iz zip archive with application binaries which 
deployed into build - artifacts directory.
2. "Functional Tests" Job - triggered from upstream "Main Build" job, takes 
as a parameter path to newly created deployment zip, make functional 
testing. 
3. "Smoke Tests" Job - triggered from upstream "Main Build" job, takes as a 
parameter path to newly created deployment zip, make smoke testing.

Also, "Main Build" job has configured "promouting builds" section, with 
promotion defined on downstream jobs completion. Promotion can include 
email-ext step where you can put anythig you want.


On Monday, November 12, 2012 8:53:40 AM UTC+2, Sven Finsterwalder wrote:
>
> We have one main-job that calls two other jobs with parameters.
> The first Job builds the product and the second job does some smoketests.
>
> The main-job now sends an email with the logoutput. My idea was to get all 
> logoutput in one log.
>
>
>

Re: Making sure jobs run in sequence

2012-11-11 Thread AdvanTiSS
You can use parameterized trigger plugin in conjunction with 
throttle-concurrency plugin(throttle category feature).


On Saturday, November 10, 2012 3:02:30 AM UTC+2, benjamin.a.lau wrote:
>
> So I've got 2 jobs
> build
> test
>
> What I want to be able to do is make sure that they always run in this 
> order and that text blocks build from running and build blocks test from 
> running. I was able to accomplish that using the Locks and Latches plugin. 
> The problem I'm running into is this...
>
> If I start a build (build 1) and then I queue another build (build 2) both 
> of these complete before test is executed. The behavior I want if for build 
> 1 to complete and test to run, then build 2 is run and test is run again. I 
> tried playing around with the quiet period for build, but that seems to be 
> counted when the job is in the queue not just after it's about to start.
>
> I could combine the two jobs... but I'd like to be able to continue to 
> execute these independently when I need since I might want to fix tests and 
> run them against the same build repeatedly.
>
> Thanks in advance,
>
> Ben
>


Re: How to get the result of the triggered job in one email

2012-11-11 Thread AdvanTiSS
What is the main idea? I'm not sure that populating downstream log into 
upstream is a right way.
Maybe promoting-plugin could help you with publishing downstream job 
results?

On Friday, November 9, 2012 5:09:14 PM UTC+2, Sven Finsterwalder wrote:
>
> Hi,
>
> *thank you for your help*
>
> now i have some lines of code that works (see below).
> *only one last question: how do i put the output into the log of the 
> parent build??*
>
> def deploymentuni = 
> Jenkins.getInstance().getItemByFullName("deployment-universal")
> def color = deploymentuni.getIconColor()
> println(color)
>  
> if(color == hudson.model.BallColor.BLUE){
>def job = 
> Jenkins.getInstance().getItemByFullName("selenium2-portalservices-Smoketests-windows-Chrome")
>def lastbuild = job.getLastBuild()
>
>println(lastbuild)
>def build = job.getBuildByNumber(lastbuild.getNumber())
>def logFilePath = build.getLogFile().getPath()
>println(logFilePath)
>String logContent = new File(logFilePath).text
>println(logContent)
> }
>
>
> Am Freitag, 9. November 2012 14:15:53 UTC+1 schrieb AdvanTiSS:
>>
>> Script language is a Groovy 
>> <http://www.google.com.ua/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCMQFjAA&url=http%3A%2F%2Fgroovy.codehaus.org%2F&ei=9P-cUMa4OIXMswadvICoAw&usg=AFQjCNHR2-H2RKw_0SISk1PgkTbA-2GRQA&sig2=0qQgOLZhKjLXIwsmnVVQwg>-
>>  
>> syntax very similar to java.
>> In groovy system script you can use all classes, their methods and 
>> properties.
>> I recommend to download jenkins-ci sources from github, open it with 
>> Intellij IDEA or Eclipse and digging here jenkins code for available 
>> classes and properties.
>>
>> You can use jenkins script console to debug your scripts
>> for example - getting build log file of job "MyJobName" build 123
>>
>> def job =Jenkins.getInstance().getItemByFullName("MyJobName")
>> def build = job.getBuildByNumber(123)
>> def logFilePath = build.getLogFile().getPath()
>>
>>
>>
>>
>>
>>
>>
>>
>> On Friday, November 9, 2012 11:18:32 AM UTC+2, Sven Finsterwalder wrote:
>>>
>>> ok... thanks.
>>> What kind of language should i use for that script? java?
>>>
>>> How can i access the log output of the downstream job?
>>>
>>> Am Freitag, 9. November 2012 09:53:52 UTC+1 schrieb AdvanTiSS:
>>>>
>>>> 1. Use Copy Artifact 
>>>> Plugin<http://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin> to 
>>>> copy artifacts from downstream job if you need
>>>> 2. Use email-ext [pre-send script] feature to modify message content
>>>> 3. Add artifacts as attachments to email
>>>>
>>>> On Friday, November 9, 2012 9:42:34 AM UTC+2, Sven Finsterwalder wrote:
>>>>>
>>>>> thank, i try it but i havent found any possibilty to add content from 
>>>>> another job to the mainjob
>>>>>
>>>>> Am Donnerstag, 8. November 2012 09:19:30 UTC+1 schrieb AdvanTiSS:
>>>>>>
>>>>>> You can try email-ext plugin
>>>>>>
>>>>>> On Wednesday, November 7, 2012 2:21:19 PM UTC+2, Sven Finsterwalder 
>>>>>> wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> i have one question.
>>>>>>> In my jenkins there is one job which starts with a parameter two 
>>>>>>> other build-jobs.
>>>>>>> The Job will fail if one of the triggered jobs fails and send one 
>>>>>>> email.
>>>>>>>
>>>>>>> I wish to add the reason in that email why the other job is failing. 
>>>>>>> Is that possible?
>>>>>>>
>>>>>>

Re: Editable Email Notification. How do I set conditional Email

2012-11-09 Thread AdvanTiSS
Huh, You're right I' not too familiar with groovy behavior, and 
yesterday while tuned email-ext publisher, i've faced with situation when 
output was null, beacuse

*cancel=cause instanceof UpstreamCause;*

returns result of last expression, but

*def cancel=cause instanceof UpstreamCause;*

returns null


On Friday, November 9, 2012 4:30:51 PM UTC+2, slide wrote:
>
> I'm pretty sure it will take the value of the last expression.
>
> Sent from my Windows Phone
> --
> From: AdvanTiSS
> Sent: 11/9/2012 7:12 AM
> To: jenkins...@googlegroups.com 
> Cc: AdvanTiSS; Varghese Renny
> Subject: Re: Editable Email Notification. How do I set conditional Email
>
> Are you sure???
> 
> ExtendedEmailPublisher.java
>
> private boolean executePresendScript(AbstractBuild build, 
> BuildListener listener, MimeMessage msg) 
> throws RuntimeException {
> .
> Object output = shell.evaluate(presendScript);
> if(output!=null) {
> pw.println("Result: "+output);
> cancel = 
> ((Boolean)shell.getVariable("cancel")).booleanValue();
> }
> 
> }
>
>
> On Friday, November 9, 2012 4:03:58 PM UTC+2, slide wrote:
>>
>> No, it doesnt
>>
>> Sent from my Windows Phone
>> --
>> From: AdvanTiSS
>> Sent: 11/9/2012 12:04 AM
>> To: jenkins...@googlegroups.com
>> Cc: Varghese Renny
>> Subject: Re: Editable Email Notification. How do I set conditional Email
>>
>> Pre-send script must have return statement
>>
>> if(cause) 
>> { 
>> cancel=true 
>> }
>> return cancel
>>
>> On Friday, November 9, 2012 7:31:34 AM UTC+2, slide wrote:
>>>
>>> Logic? 
>>> MIME-Version: 1.0 
>>> Content-Type: multipart/alternative; 
>>> boundary=f46d044306707d987804ce08ac46 
>>>
>>> --f46d044306707d987804ce08ac46 
>>> Content-Type: text/plain; charset="utf-8" 
>>> Content-Transfer-Encoding: 7bit 
>>>
>>> Also what do you mean based on the results? Based on the return code? 
>>> Based on some output from an app? 
>>>
>>> Sent from my Windows Phone 
>>> From: Varghese Renny 
>>> Sent: 11/8/2012 9:49 PM 
>>> To: jenkins...@googlegroups.com 
>>> Subject: Re: Editable Email Notification. How do I set conditional 
>>> Email Logic? 
>>> Hi Tom, 
>>>
>>> In presend script you can mention like this.. 
>>>
>>> import hudson.model.Cause.UpstreamCause 
>>>  def cause = build.causes.find { 
>>>   if(it instanceof hudson.model.Cause.UpstreamCause) { 
>>>   return true 
>>>   } 
>>>   return false 
>>>  } 
>>>
>>> if(cause) 
>>> { 
>>> cancel=true 
>>> } 
>>>
>>> I don't know how it cancel based on shell..Probably you can check some 
>>> api's. 
>>> What's your shell script actually doing? 
>>>
>>> Regards, 
>>> varghese 
>>>
>>> On Fri, Nov 9, 2012 at 4:45 AM, Tom80112  wrote: 
>>>
>>> > Inside my "execute shell" window I perform script logic. 
>>> > 
>>> > Based on the results within the "execute shell" window, I may or may 
>>> > not want to send email via the Jenkins Email Extension Plugin. 
>>> > 
>>> > I have read that I can set up a pre-send script to cancel email being 
>>> > set up by setting cancel=true. 
>>> > 
>>> > My question is how how I set cancel=true based upon the outcome of 
>>> > logic within the "execute shell" window?   There is no way to pass a 
>>> > variable from the "execute shell" window to the pre-send script..  
>>> > 
>>> > Please Help.. :) 
>>> > 
>>> > 
>>> > 
>>> > -- 
>>> > View this message in context: 
>>> > 
>>> http://jenkins.361315.n4.nabble.com/Editable-Email-Notification-How-do-I-set-conditional-Email-Logic-tp4645626.html
>>>  
>>> > Sent from the Jenkins users mailing list archive at Nabble.com. 
>>> > 
>>>
>>> --f46d044306707d987804ce08ac46 
>>> Content-Type: text/html; charset="utf-8" 
>>> Content-Transfer-Encoding: quoted-printable 
>>>
>>> >> http-

Re: Editable Email Notification. How do I set conditional Email

2012-11-09 Thread AdvanTiSS
Are you sure???

ExtendedEmailPublisher.java

private boolean executePresendScript(AbstractBuild build, 
BuildListener listener, MimeMessage msg) 
throws RuntimeException {
.
Object output = shell.evaluate(presendScript);
if(output!=null) {
pw.println("Result: "+output);
cancel = 
((Boolean)shell.getVariable("cancel")).booleanValue();
}

}


On Friday, November 9, 2012 4:03:58 PM UTC+2, slide wrote:
>
> No, it doesnt
>
> Sent from my Windows Phone
> --
> From: AdvanTiSS
> Sent: 11/9/2012 12:04 AM
> To: jenkins...@googlegroups.com 
> Cc: Varghese Renny
> Subject: Re: Editable Email Notification. How do I set conditional Email
>
> Pre-send script must have return statement
>
> if(cause) 
> { 
> cancel=true 
> }
> return cancel
>
> On Friday, November 9, 2012 7:31:34 AM UTC+2, slide wrote:
>>
>> Logic? 
>> MIME-Version: 1.0 
>> Content-Type: multipart/alternative; 
>> boundary=f46d044306707d987804ce08ac46 
>>
>> --f46d044306707d987804ce08ac46 
>> Content-Type: text/plain; charset="utf-8" 
>> Content-Transfer-Encoding: 7bit 
>>
>> Also what do you mean based on the results? Based on the return code? 
>> Based on some output from an app? 
>>
>> Sent from my Windows Phone 
>> From: Varghese Renny 
>> Sent: 11/8/2012 9:49 PM 
>> To: jenkins...@googlegroups.com 
>> Subject: Re: Editable Email Notification. How do I set conditional 
>> Email Logic? 
>> Hi Tom, 
>>
>> In presend script you can mention like this.. 
>>
>> import hudson.model.Cause.UpstreamCause 
>>  def cause = build.causes.find { 
>>   if(it instanceof hudson.model.Cause.UpstreamCause) { 
>>   return true 
>>   } 
>>   return false 
>>  } 
>>
>> if(cause) 
>> { 
>> cancel=true 
>> } 
>>
>> I don't know how it cancel based on shell..Probably you can check some 
>> api's. 
>> What's your shell script actually doing? 
>>
>> Regards, 
>> varghese 
>>
>> On Fri, Nov 9, 2012 at 4:45 AM, Tom80112  wrote: 
>>
>> > Inside my "execute shell" window I perform script logic. 
>> > 
>> > Based on the results within the "execute shell" window, I may or may 
>> > not want to send email via the Jenkins Email Extension Plugin. 
>> > 
>> > I have read that I can set up a pre-send script to cancel email being 
>> > set up by setting cancel=true. 
>> > 
>> > My question is how how I set cancel=true based upon the outcome of 
>> > logic within the "execute shell" window?   There is no way to pass a 
>> > variable from the "execute shell" window to the pre-send script..  
>> > 
>> > Please Help.. :) 
>> > 
>> > 
>> > 
>> > -- 
>> > View this message in context: 
>> > 
>> http://jenkins.361315.n4.nabble.com/Editable-Email-Notification-How-do-I-set-conditional-Email-Logic-tp4645626.html
>>  
>> > Sent from the Jenkins users mailing list archive at Nabble.com. 
>> > 
>>
>> --f46d044306707d987804ce08ac46 
>> Content-Type: text/html; charset="utf-8" 
>> Content-Transfer-Encoding: quoted-printable 
>>
>> > http-equiv=3D"Cont= 
>> ent-Type">> Calibri,sans-serif; = 
>> font-size: 11pt;">Also what do you mean based on the results? Based on 
>> the = 
>> return code? Based on some output from an app?Sent from my 
>> Windows = 
>> Phone> fon= 
>> t-size: 10pt; font-weight: bold;">From: > style=3D"font-family: = 
>> Tahoma,sans-serif; font-size: 10pt;">Varghese Renny> style= 
>> =3D"font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: 
>> bold;">Se= 
>> nt: > 10pt;"= 
>> >11/8/2012 9:49 PM> Tahoma,sans-serif;= 
>>  font-size: 10pt; font-weight: bold;">To: > style=3D"font-family= 
>> : Tahoma,sans-serif; font-size: 10pt;">jenkins...@googlegroups.com> an>> font= 
>> -weight: bold;">Subject: > Tahoma,sans-ser= 
>> if; font-size: 10pt;">Re: Editable Email Notification. How do I set 
>> conditi= 
>> onal Email Logic?Hi Tom,In presend 
>> scr= 
>> ipt you can mention like this..import 
>> hudson.model.Cause.UpstreamCa= 
>> use=C2=A0def cause =3D build.causes

Re: Programmatically adding a Publisher

2012-11-09 Thread AdvanTiSS
i think you should invoke project.save() method

On Friday, November 9, 2012 11:43:01 AM UTC+2, wolfgang wrote:
>
> Hi! 
>
> I'm programmatically adding a Publisher in my plugin. The 
> ProjectAction is working correctly, but the UI isn't showing until I 
> restart Jenkins? 
> If I enable it manually, the UI is shown. 
>
> Can I somehow activate the UI programmatically? Or is there a correct 
> way to do it? 
>
> Thanks. 
>
> Christian Wolfgang 
>


Re: How to get the result of the triggered job in one email

2012-11-09 Thread AdvanTiSS
Script language is a Groovy 
<http://www.google.com.ua/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCMQFjAA&url=http%3A%2F%2Fgroovy.codehaus.org%2F&ei=9P-cUMa4OIXMswadvICoAw&usg=AFQjCNHR2-H2RKw_0SISk1PgkTbA-2GRQA&sig2=0qQgOLZhKjLXIwsmnVVQwg>-
 
syntax very similar to java.
In groovy system script you can use all classes, their methods and 
properties.
I recommend to download jenkins-ci sources from github, open it with 
Intellij IDEA or Eclipse and digging here jenkins code for available 
classes and properties.

You can use jenkins script console to debug your scripts
for example - getting build log file of job "MyJobName" build 123

def job =Jenkins.getInstance().getItemByFullName("MyJobName")
def build = job.getBuildByNumber(123)
def logFilePath = build.getLogFile().getPath()








On Friday, November 9, 2012 11:18:32 AM UTC+2, Sven Finsterwalder wrote:
>
> ok... thanks.
> What kind of language should i use for that script? java?
>
> How can i access the log output of the downstream job?
>
> Am Freitag, 9. November 2012 09:53:52 UTC+1 schrieb AdvanTiSS:
>>
>> 1. Use Copy Artifact 
>> Plugin<http://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin> to 
>> copy artifacts from downstream job if you need
>> 2. Use email-ext [pre-send script] feature to modify message content
>> 3. Add artifacts as attachments to email
>>
>> On Friday, November 9, 2012 9:42:34 AM UTC+2, Sven Finsterwalder wrote:
>>>
>>> thank, i try it but i havent found any possibilty to add content from 
>>> another job to the mainjob
>>>
>>> Am Donnerstag, 8. November 2012 09:19:30 UTC+1 schrieb AdvanTiSS:
>>>>
>>>> You can try email-ext plugin
>>>>
>>>> On Wednesday, November 7, 2012 2:21:19 PM UTC+2, Sven Finsterwalder 
>>>> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> i have one question.
>>>>> In my jenkins there is one job which starts with a parameter two other 
>>>>> build-jobs.
>>>>> The Job will fail if one of the triggered jobs fails and send one 
>>>>> email.
>>>>>
>>>>> I wish to add the reason in that email why the other job is failing. 
>>>>> Is that possible?
>>>>>
>>>>

Re: How to get the result of the triggered job in one email

2012-11-09 Thread AdvanTiSS
1. Use Copy Artifact 
Plugin<http://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin> to 
copy artifacts from downstream job if you need
2. Use email-ext [pre-send script] feature to modify message content
3. Add artifacts as attachments to email

On Friday, November 9, 2012 9:42:34 AM UTC+2, Sven Finsterwalder wrote:
>
> thank, i try it but i havent found any possibilty to add content from 
> another job to the mainjob
>
> Am Donnerstag, 8. November 2012 09:19:30 UTC+1 schrieb AdvanTiSS:
>>
>> You can try email-ext plugin
>>
>> On Wednesday, November 7, 2012 2:21:19 PM UTC+2, Sven Finsterwalder wrote:
>>>
>>> Hello,
>>>
>>> i have one question.
>>> In my jenkins there is one job which starts with a parameter two other 
>>> build-jobs.
>>> The Job will fail if one of the triggered jobs fails and send one email.
>>>
>>> I wish to add the reason in that email why the other job is failing. Is 
>>> that possible?
>>>
>>

Re: Single email notification from a muti-configuration project

2012-11-09 Thread AdvanTiSS
You can ask for email-ext plugin feature on Jenkins JIRA, or implement this.

On Friday, November 9, 2012 9:29:44 AM UTC+2, Chai wrote:
>
> We currently use email-ext plugin for enabling email notifications on 
> builds. 
>
> We see that the users are receiving mutiple notifications if the project 
> is configured as a muti-configuration project. 
>
> Is there a way to send a single email instead.
>
> Jenkins version1.404 
> Email-ext version  2.14
>
> Thanks
> Chaitanya
>


Re: Editable Email Notification. How do I set conditional Email

2012-11-08 Thread AdvanTiSS
And the simpliest way is to create some output file in shell script if 
sending approved.
And pre-send will do something like

cancel = new File(workspace, fileName).exists()





Re: Editable Email Notification. How do I set conditional Email

2012-11-08 Thread AdvanTiSS
Pre-send script must have return statement

if(cause) 
{ 
cancel=true 
}
return cancel

On Friday, November 9, 2012 7:31:34 AM UTC+2, slide wrote:
>
> Logic? 
> MIME-Version: 1.0 
> Content-Type: multipart/alternative; boundary=f46d044306707d987804ce08ac46 
>
> --f46d044306707d987804ce08ac46 
> Content-Type: text/plain; charset="utf-8" 
> Content-Transfer-Encoding: 7bit 
>
> Also what do you mean based on the results? Based on the return code? 
> Based on some output from an app? 
>
> Sent from my Windows Phone 
> From: Varghese Renny 
> Sent: 11/8/2012 9:49 PM 
> To: jenkins...@googlegroups.com  
> Subject: Re: Editable Email Notification. How do I set conditional 
> Email Logic? 
> Hi Tom, 
>
> In presend script you can mention like this.. 
>
> import hudson.model.Cause.UpstreamCause 
>  def cause = build.causes.find { 
>   if(it instanceof hudson.model.Cause.UpstreamCause) { 
>   return true 
>   } 
>   return false 
>  } 
>
> if(cause) 
> { 
> cancel=true 
> } 
>
> I don't know how it cancel based on shell..Probably you can check some 
> api's. 
> What's your shell script actually doing? 
>
> Regards, 
> varghese 
>
> On Fri, Nov 9, 2012 at 4:45 AM, Tom80112 > 
> wrote: 
>
> > Inside my "execute shell" window I perform script logic. 
> > 
> > Based on the results within the "execute shell" window, I may or may 
> > not want to send email via the Jenkins Email Extension Plugin. 
> > 
> > I have read that I can set up a pre-send script to cancel email being 
> > set up by setting cancel=true. 
> > 
> > My question is how how I set cancel=true based upon the outcome of 
> > logic within the "execute shell" window?   There is no way to pass a 
> > variable from the "execute shell" window to the pre-send script..  
> > 
> > Please Help.. :) 
> > 
> > 
> > 
> > -- 
> > View this message in context: 
> > 
> http://jenkins.361315.n4.nabble.com/Editable-Email-Notification-How-do-I-set-conditional-Email-Logic-tp4645626.html
>  
> > Sent from the Jenkins users mailing list archive at Nabble.com. 
> > 
>
> --f46d044306707d987804ce08ac46 
> Content-Type: text/html; charset="utf-8" 
> Content-Transfer-Encoding: quoted-printable 
>
>  http-equiv=3D"Cont= 
> ent-Type"> = 
> font-size: 11pt;">Also what do you mean based on the results? Based on the 
> = 
> return code? Based on some output from an app?Sent from my Windows 
> = 
> Phone fon= 
> t-size: 10pt; font-weight: bold;">From:  = 
> Tahoma,sans-serif; font-size: 10pt;">Varghese Renny =3D"font-family: Tahoma,sans-serif; font-size: 10pt; font-weight: 
> bold;">Se= 
> nt:  10pt;"= 
> >11/8/2012 9:49 PM Tahoma,sans-serif;= 
>  font-size: 10pt; font-weight: bold;">To:  style=3D"font-family= 
> : Tahoma,sans-serif; font-size: 
> 10pt;">jenkins...@googlegroups.com
> an> font= 
> -weight: bold;">Subject:  Tahoma,sans-ser= 
> if; font-size: 10pt;">Re: Editable Email Notification. How do I set 
> conditi= 
> onal Email Logic?Hi Tom,In presend 
> scr= 
> ipt you can mention like this..import 
> hudson.model.Cause.UpstreamCa= 
> use=C2=A0def cause =3D build.causes.find 
> {=C2=A0=C2=A0=C2=A0=C2=A0= 
> =C2=A0 if(it instanceof hudson.model.Cause.UpstreamCause) 
> {=C2=A0=C2=A0= 
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return true 
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 
> f= 
> alse=C2=A0}if(cause){cancel=3Dtrue}I 
> don= 
> 9;t know how it cancel based on shell..Probably you can check some 
> api'= 
> s. 
> What's your shell script actually doing? 
> Regards,varghese On Fri, Nov 9, 
> = 
> 2012 at 4:45 AM, Tom80112 < nez...@ya = 
> hoo.com" target=3D"_blank">nez...@yahoo.com > 
> wrote: quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px 
> #ccc= 
>  solid;padding-left:1ex"> 
> Inside my "execute shell" window I perform script logic. 
>  
> Based on the results within the "execute shell" window, I may or 
> = 
> may 
> not want to send email via the Jenkins Email Extension Plugin. 
>  
> I have read that I can set up a pre-send script to cancel email being 
> set up by setting cancel=3Dtrue. 
>  
> My question is how how I set cancel=3Dtrue based upon the outcome of 
> logic within the "execute shell" window? =C2=A0 There is no way 
> t= 
> o pass a 
> variable from the "execute shell" window to the pre-send 
> script..= 
>   
>  
> Please Help.. :) 
>  
>  
>  
> -- 
> View this message in context:  http://jenkins.361315.n4.nabble.co= 
> m/Editable-Email-Notification-How-do-I-set-conditional-Email-Logic-tp464562= 
>
> 6.html" target=3D"_blank">http://jenkins.361315.n4.nabble.com/Editable-Emai= 
>
> l-Notification-How-do-I-set-conditional-Email-Logic-tp4645626.html
>  
>
>
> Sent from the Jenkins users mailing list archive at Nabble.com. 
>  
>
> --f46d044306707d987804ce08ac46-- 
>


Re: job/api/json doesn't list running jobs anymore

2012-11-08 Thread AdvanTiSS
I've found out today that if job config has [throttle concurrent] property 
disabled but has ThrottleJobProperty node in xml - it does'nt appear in 
executor status sidepanel.

On Thursday, November 8, 2012 10:28:41 AM UTC+2, Lukas Rytz wrote:
>
> I have the Throttle Concurrent Builds Plug-in installed as well, but not 
> the NodeLabel Parameter Plugin
>
> On Thursday, November 8, 2012 9:22:59 AM UTC+1, AdvanTiSS wrote:
>>
>> Similar problem - after updating from 1.477 to 1.487 - running builds 
>> don't appear in build executor status on Jenkins dashboard. I suspecting 
>> [throttle-build-concurrency] and [nodelabel-parameter] plugins also.
>>
>> On Wednesday, November 7, 2012 11:13:12 AM UTC+2, Lukas Rytz wrote:
>>>
>>> Hi,
>>>
>>> Sometime between 1.478 and 1.488 the output 
>>> of JENKINS_URL/job/JOB_NAME/api/json changed.
>>> Before, the "builds" array would include running builds, now it only 
>>> lists the finished builds.
>>>
>>> Since I did not see that change listed in the change log, I wonder if 
>>> it's expected. If so, is there a way
>>> to get the list of currently running builds of some job?
>>>
>>> Thanks: Lukas
>>>
>>>

Re: Fingerprinting

2012-11-08 Thread AdvanTiSS
I think sometimes fingerprints map can consume large amounts of memory, but 
for not long time. SoftReference allows allocated memory will be released 
if another proccess will query more memory.

On Thursday, November 8, 2012 5:33:53 PM UTC+2, qazwart wrote:
>
> So fingerprinting is memory intensive. Storing thousands of fingerprints 
> for every build isn't going to work. 
>
> --
> David Weintraub
> da...@weintraub.name 
>
> On Nov 8, 2012, at 9:58 AM, AdvanTiSS > 
> wrote:
>
> After digging code deeper, i've found that fingerprints are instances of 
> SoftReference class 
> From javadoc:
>  ** Soft reference objects, which are cleared at the discretion of the 
> garbage*
> * * collector in response to memory demand.  Soft references are most 
> often used*
> * * to implement memory-sensitive caches.*
>
>
> On Thursday, November 8, 2012 2:35:45 PM UTC+2, qazwart wrote:
>>
>> I understand how the fingerprinting process works and I use it to mark 
>> our jars, wars, ears, and zips.
>>
>> However, I was thinking of fingerprinting every file in a zip for every 
>> build. This way, we can trace back each file when the archive is unzipped 
>> and its contents scattered. That could mean finger printing hundreds or 
>> thousands of files in each build.
>>
>> I suspect that may add a few minutes to the build, but how will tracking 
>> all those finger prints affect Jenkins performance?
>>
>> --
>> David Weintraub
>> da...@weintraub.name
>>
>> On Nov 8, 2012, at 3:09 AM, AdvanTiSS  wrote:
>>
>> Fingerprinting process based on md5 checksum calculation 
>> using java.security.DigestInputStream on each file targeted for 
>> fingerprinting.
>> You can read some information about md5 algorithm performance here - [Secure 
>> hash functions in 
>> Java<http://www.javamex.com/tutorials/cryptography/hash_functions_algorithms.shtml>
>> ].
>>
>> On Wednesday, November 7, 2012 3:44:11 PM UTC+2, qazwart wrote:
>>>
>>> How resource intensive is fingerprinting? What if I fingerprint all 
>>> files that I build? 
>>>
>>> We deploy a lot of zipped archives instead of jars and wars in our JBoss 
>>> instant. This way, we can generate various client configurations. However, 
>>> it also means that the build assets can get moved around quite a bit, and 
>>> I'd like someway of determining what build that file was associated with. 
>>> Right now, I'm just fingerprinting the zipped archive, but it may be better 
>>> if I fingerprinted all the files inside the archive before it is zipped. 
>>>
>>> I can't imagine fingerprinting taking up a lot of resources, on a per 
>>> file basis, but if I am fingerprinting hundreds of files per build, I can 
>>> imagine it being a problem. 
>>>
>>> What is your policy on fingerprinting files?
>>
>>

Re: Fingerprinting

2012-11-08 Thread AdvanTiSS
After digging code deeper, i've found that fingerprints are instances of 
SoftReference class 
>From javadoc:
 ** Soft reference objects, which are cleared at the discretion of the 
garbage*
* * collector in response to memory demand.  Soft references are most often 
used*
* * to implement memory-sensitive caches.*


On Thursday, November 8, 2012 2:35:45 PM UTC+2, qazwart wrote:
>
> I understand how the fingerprinting process works and I use it to mark our 
> jars, wars, ears, and zips.
>
> However, I was thinking of fingerprinting every file in a zip for every 
> build. This way, we can trace back each file when the archive is unzipped 
> and its contents scattered. That could mean finger printing hundreds or 
> thousands of files in each build.
>
> I suspect that may add a few minutes to the build, but how will tracking 
> all those finger prints affect Jenkins performance?
>
> --
> David Weintraub
> da...@weintraub.name 
>
> On Nov 8, 2012, at 3:09 AM, AdvanTiSS > 
> wrote:
>
> Fingerprinting process based on md5 checksum calculation 
> using java.security.DigestInputStream on each file targeted for 
> fingerprinting.
> You can read some information about md5 algorithm performance here - [Secure 
> hash functions in 
> Java<http://www.javamex.com/tutorials/cryptography/hash_functions_algorithms.shtml>
> ].
>
> On Wednesday, November 7, 2012 3:44:11 PM UTC+2, qazwart wrote:
>>
>> How resource intensive is fingerprinting? What if I fingerprint all files 
>> that I build? 
>>
>> We deploy a lot of zipped archives instead of jars and wars in our JBoss 
>> instant. This way, we can generate various client configurations. However, 
>> it also means that the build assets can get moved around quite a bit, and 
>> I'd like someway of determining what build that file was associated with. 
>> Right now, I'm just fingerprinting the zipped archive, but it may be better 
>> if I fingerprinted all the files inside the archive before it is zipped. 
>>
>> I can't imagine fingerprinting taking up a lot of resources, on a per 
>> file basis, but if I am fingerprinting hundreds of files per build, I can 
>> imagine it being a problem. 
>>
>> What is your policy on fingerprinting files?
>
>

Re: Groovy script to abort current build and skip other action of the job

2012-11-08 Thread AdvanTiSS
"Since the user can trigger that kind of command via the UI there should be 
some corresponding API for that, right?"

Stopping via UI executes the same [build.getExecutor().interrupt()], so you 
may have same problems with aborting builds from UI. 
Also, want notice that after upgrading from 1.477 to 1.487 we get some 
problems with downstream builds aborting - jenkins lost ability to abort 
them from UI.

On Thursday, November 8, 2012 10:49:08 AM UTC+2, dthomas wrote:
>
> As mentioned in my original post both of the following will mark the build 
> as failed (not aborted) and will also process all further build actions: 
>build.getExecutor().interrupt() 
>build.getExecutor().interrupt(Result.ABORTED) 
>
> Especially that the second line marks the build as failed I would call 
> broken. 
>
> - Dirk 
>
>
> On 08.11.2012 00:40, AdvanTiSS wrote: 
> > build.getExecutor().interrupt(); 
> > 
> > On Monday, November 5, 2012 8:51:07 AM UTC+2, dthomas wrote: 
> > 
> > bump :-) 
> > 
> > Since the user can trigger that kind of command via the UI there 
> should be some corresponding API for that, right? 
> > I only found methods with Stapler request and response objects as 
> parameters - but I should rather not pass fake arguments I guess. 
> > 
> > Can somebody confirm that no corresponding API exists currently? 
> > Than I would fill an enhancement request to add that kind of method 
> to the a build. 
> > 
> > - Dirk 
> > 
> > 
> > On Wednesday, October 24, 2012 11:24:10 AM UTC-7, dthomas wrote: 
> > 
> > I have a job which is pretty resource intensive. 
> > That's why i want it to be executed only when all upstream jobs 
> are stable. 
> > 
> > Therefore I prepended a groovy script action to the job 
> (original action now #2). 
> > The groovy script checks that all upstream jobs are stable. 
> > But I am unable to stop the build from groovy so that: 
> > - the job is marked as "aborted" (not failed) 
> > AND 
> > - the following actions in that job are not executed 
> > 
> > I am able to set the result of the build with: 
> >build = Thread.currentThread().executable 
> >build.setResult(Result.ABORTED) 
> > But this would obviously continue the build and execute the 
> following actions. 
> > 
> > Both of the following will mark the build as failed and will 
> also process all action: 
> >build.getExecutor().interrupt() 
> >build.getExecutor().interrupt(Result.ABORTED) 
> > 
> > Any hint how to abort the job after the first action / groovy 
> script without executing the following actions AND marking the job as 
> ABORTED? 
> > 
> > Thanks, 
> > Dirk 
> > 
>
>

Re: Groovy script to abort current build and skip other action of the job

2012-11-08 Thread AdvanTiSS
build.getExecutor().interrupt();

On Monday, November 5, 2012 8:51:07 AM UTC+2, dthomas wrote:
>
> bump :-)
>
> Since the user can trigger that kind of command via the UI there should be 
> some corresponding API for that, right?
> I only found methods with Stapler request and response objects as 
> parameters - but I should rather not pass fake arguments I guess.
>
> Can somebody confirm that no corresponding API exists currently?
> Than I would fill an enhancement request to add that kind of method to the 
> a build.
>
> - Dirk
>
>
> On Wednesday, October 24, 2012 11:24:10 AM UTC-7, dthomas wrote:
>>
>> I have a job which is pretty resource intensive.
>> That's why i want it to be executed only when all upstream jobs are 
>> stable.
>>
>> Therefore I prepended a groovy script action to the job (original action 
>> now #2).
>> The groovy script checks that all upstream jobs are stable.
>> But I am unable to stop the build from groovy so that:
>> - the job is marked as "aborted" (not failed)
>> AND
>> - the following actions in that job are not executed
>>
>> I am able to set the result of the build with:
>>   build = Thread.currentThread().executable
>>   build.setResult(Result.ABORTED)
>> But this would obviously continue the build and execute the following 
>> actions.
>>
>> Both of the following will mark the build as failed and will also process 
>> all action:
>>   build.getExecutor().interrupt()
>>   build.getExecutor().interrupt(Result.ABORTED)
>>
>> Any hint how to abort the job after the first action / groovy script 
>> without executing the following actions AND marking the job as ABORTED?
>>
>> Thanks,
>> Dirk
>>
>

Re: job/api/json doesn't list running jobs anymore

2012-11-08 Thread AdvanTiSS
Similar problem - after updating from 1.477 to 1.487 - running builds don't 
appear in build executor status on Jenkins dashboard. I suspecting 
[throttle-build-concurrency] and [nodelabel-parameter] plugins also.

On Wednesday, November 7, 2012 11:13:12 AM UTC+2, Lukas Rytz wrote:
>
> Hi,
>
> Sometime between 1.478 and 1.488 the output 
> of JENKINS_URL/job/JOB_NAME/api/json changed.
> Before, the "builds" array would include running builds, now it only lists 
> the finished builds.
>
> Since I did not see that change listed in the change log, I wonder if it's 
> expected. If so, is there a way
> to get the list of currently running builds of some job?
>
> Thanks: Lukas
>
>

Re: How to get the result of the triggered job in one email

2012-11-08 Thread AdvanTiSS
You can try email-ext plugin

On Wednesday, November 7, 2012 2:21:19 PM UTC+2, Sven Finsterwalder wrote:
>
> Hello,
>
> i have one question.
> In my jenkins there is one job which starts with a parameter two other 
> build-jobs.
> The Job will fail if one of the triggered jobs fails and send one email.
>
> I wish to add the reason in that email why the other job is failing. Is 
> that possible?
>


Re: Fingerprinting

2012-11-08 Thread AdvanTiSS
As you can see on chart, md5 hashing time almost independent from file 
size, therefore fingerprinting will depend mostly from your server 
configuration.

On Thursday, November 8, 2012 10:09:27 AM UTC+2, AdvanTiSS wrote:
>
> Fingerprinting process based on md5 checksum calculation 
> using java.security.DigestInputStream on each file targeted for 
> fingerprinting.
> You can read some information about md5 algorithm performance here - [Secure 
> hash functions in 
> Java<http://www.javamex.com/tutorials/cryptography/hash_functions_algorithms.shtml>
> ].
>
> On Wednesday, November 7, 2012 3:44:11 PM UTC+2, qazwart wrote:
>>
>> How resource intensive is fingerprinting? What if I fingerprint all files 
>> that I build? 
>>
>> We deploy a lot of zipped archives instead of jars and wars in our JBoss 
>> instant. This way, we can generate various client configurations. However, 
>> it also means that the build assets can get moved around quite a bit, and 
>> I'd like someway of determining what build that file was associated with. 
>> Right now, I'm just fingerprinting the zipped archive, but it may be better 
>> if I fingerprinted all the files inside the archive before it is zipped. 
>>
>> I can't imagine fingerprinting taking up a lot of resources, on a per 
>> file basis, but if I am fingerprinting hundreds of files per build, I can 
>> imagine it being a problem. 
>>
>> What is your policy on fingerprinting files?
>
>

Re: Fingerprinting

2012-11-08 Thread AdvanTiSS
Fingerprinting process based on md5 checksum calculation 
using java.security.DigestInputStream on each file targeted for 
fingerprinting.
You can read some information about md5 algorithm performance here - [Secure 
hash functions in 
Java
].

On Wednesday, November 7, 2012 3:44:11 PM UTC+2, qazwart wrote:
>
> How resource intensive is fingerprinting? What if I fingerprint all files 
> that I build? 
>
> We deploy a lot of zipped archives instead of jars and wars in our JBoss 
> instant. This way, we can generate various client configurations. However, 
> it also means that the build assets can get moved around quite a bit, and 
> I'd like someway of determining what build that file was associated with. 
> Right now, I'm just fingerprinting the zipped archive, but it may be better 
> if I fingerprinted all the files inside the archive before it is zipped. 
>
> I can't imagine fingerprinting taking up a lot of resources, on a per file 
> basis, but if I am fingerprinting hundreds of files per build, I can 
> imagine it being a problem. 
>
> What is your policy on fingerprinting files?