Re: Eamil-ext plugin add text to msg
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 sab...@gmail.comwrote: 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: Eamil-ext plugin add text to msg
Yes in [selOutput] i see the logoutput. Am Mittwoch, 14. November 2012 09:50:06 UTC+1 schrieb 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 sab...@gmail.comwrote: 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: Eamil-ext plugin add text to msg
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 sab...@gmail.comwrote: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
Re: Eamil-ext plugin add text to msg
Yes that works... How can i add now this two vaulue to that email: ${BUILD_URL} br ${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 sab...@gmail.comjavascript: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
Re: Eamil-ext plugin add text to msg
Now i try that solution: def deploymentJob = Jenkins.getInstance().getItemByFullName(deployment-universal) def deploymentUrl = deploymentJob.getLastCompletedBuild().getAbsoluteUrl() def statusDeployment = deploymentJob.getLastCompletedBuild().getResult() println(+statusDeployment +\n+ deploymentUrl+\n) def testJob = Jenkins.getInstance().getItemByFullName(selenium2-portalservices-Smoketests-windows-Chrome-2.2) def testJobUrl = testJob.getLastCompletedBuild().getAbsoluteUrl() def statusTestJob = testJob.getLastCompletedBuild().getResult() println(+statusTestJob +\n+ testJobUrl+\n) if(statusDeployment == hudson.model.Result.SUCCESS statusTestJob != hudson.model.Result.SUCCESS){ 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) } Can you give me feedback about that? Am Mittwoch, 14. November 2012 12:35:37 UTC+1 schrieb Sven Finsterwalder: Yes that works... How can i add now this two vaulue to that email: ${BUILD_URL} br ${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 sab...@gmail.comwrote: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
RE: Eamil-ext plugin add text to msg
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: jenkinsci-users@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} br ${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 sab...@gmail.comjavascript: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
Re: Eamil-ext plugin add text to msg
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 javascript: 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} br ${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 sab...@gmail.comwrote: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
Re: Eamil-ext plugin add text to msg
But when i put it into the content template then all other jobs will also send this content if it use the editable email notification? Can i put it also in the Default Content? Am Mittwoch, 14. November 2012 13:22:13 UTC+1 schrieb slide: 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 javascript: 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} br ${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 sab...@gmail.comwrote: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
Re: Eamil-ext plugin add text to msg
Yes thats what i mean. Am Mittwoch, 14. November 2012 13:26:25 UTC+1 schrieb 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} br ${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 sab...@gmail.comwrote: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
RE: Eamil-ext plugin add text to msg
Please look at the wiki where it talks about groovy templates. You can do checks for things just like the code you have in the pre-send script, but then you don't have to worry about modifying the message afterward. Sent from my Windows Phone -- From: Sven Finsterwalder Sent: 11/14/2012 5:32 AM To: jenkinsci-users@googlegroups.com Cc: Sven Finsterwalder Subject: Re: Eamil-ext plugin add text to msg Yes thats what i mean. Am Mittwoch, 14. November 2012 13:26:25 UTC+1 schrieb 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} br ${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 sab...@gmail.comwrote: 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 sab...@gmail.comwrote: 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 http://earl-of-code.com -- Website: http://earl-of-code.com
Re: Eamil-ext plugin add text to msg
Please show your code. On Tue, Nov 13, 2012 at 8:01 AM, Sven Finsterwalder sab...@gmail.comwrote: 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: Eamil-ext plugin add text to msg
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 sab...@gmail.comjavascript: 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