[JIRA] (JENKINS-37886) is it possible to send email notification from a pipeline

0 görüntüleme
İlk okunmamış mesaja atla

dearpedda@gmail.com (JIRA)

okunmadı,
1 Eyl 2016 06:12:101.09.2016
alıcı jenkinsc...@googlegroups.com
Pedda Reddy created an issue
 
Jenkins / Task JENKINS-37886
is it possible to send email notification from a pipeline
Issue Type: Task Task
Assignee: Oleg Nenashev
Components: _unsorted
Created: 2016/Sep/01 10:11 AM
Priority: Minor Minor
Reporter: Pedda Reddy

Is it possible to send an email notification in pipeline, based on the completion of pipeline segments I want to send out emails. the mail-ext plugin doesn't show any options when I create a job with pipeline. I'm checking if I can acheieve the same using groovy scripting, but no headway so far.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

dearpedda@gmail.com (JIRA)

okunmadı,
1 Eyl 2016 06:13:011.09.2016
alıcı jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

okunmadı,
13 Eyl 2016 10:52:0413.09.2016
alıcı jenkinsc...@googlegroups.com

dearpedda@gmail.com (JIRA)

okunmadı,
16 Eyl 2016 05:12:0116.09.2016
alıcı jenkinsc...@googlegroups.com

dearpedda@gmail.com (JIRA)

okunmadı,
16 Eyl 2016 05:59:0116.09.2016
alıcı jenkinsc...@googlegroups.com
Pedda Reddy edited a comment on Task JENKINS-37886
Thanks Nenashev ! I'm able to use the mail step. But, I'm facing issue after I included mail step in my pipeline script.

Please find below the script.

[node
{
    
   def applicationConfigObj
   def tibcoAppConfGenertorObj
   //def notifyObj
   
   stage 'TibcoConfig'
   echo 'Reading Tibco configuration!'
   
    def parent = getClass().getClassLoader()
    def loader = new GroovyClassLoader(parent)

applicationConfigObj = loader.parseClass(new File("/opt/tibco/deploy_tool/Tibco_Automation/src/com/merck/comet/ApplicationConfig.groovy")).newInstance()
tibcoAppConfGenertorObj = loader.parseClass(new File("/opt/tibco/deploy_tool/Tibco_Automation/src/com/merck/comet/TibcoAppConfGenertor.groovy")).newInstance()
    //notifyObj = loader.parseClass(new File("/opt/tibco/deploy_tool/Tibco_Automation/src/com/merck/comet/Notification.groovy")).newInstance()

//tibcoAppConfGenertorObj.generateServiceXML()

    //def sendTo = "peddared...@company.com,peddar...@company.com";
    //println(sendTo)
    //notifyObj.sendNotification();

mail (to: 'peddared...@merck.com',
         subject: "Job '${env.JOB_NAME}' (${env.BUILD_NUMBER}) is waiting for input",
         body: "Please go to ${env.BUILD_URL}.");
     input 'Ready to go?';
    
    

    stage 'ApplicationDownTime'
    echo 'Application DownTime goes here!'
    

    stage 'RetryDownTimeActivities'
    echo 'Retry goes here!'
    
    stage 'Notify'
    echo 'Notifying to group of users!'
}
]

The above script is able to send the email, but the job is failing with below exception. Should the mail step be separate always ?

Exception Below

river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)

dearpedda@gmail.com (JIRA)

okunmadı,
16 Eyl 2016 06:05:0116.09.2016
alıcı jenkinsc...@googlegroups.com
java.io.NotSerializableException: com.merck.comet.TibcoAppConfGenertor
at org.jboss.marshalling.
river.RiverMarshaller. doWriteObject(RiverMarshaller.java:860)

at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.HashMap.writeObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:271)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:976)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)

river.RiverMarshaller.
doWriteFields(RiverMarshaller.java:1032)

at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:967)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
at org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
at org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
at org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
at org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)

o.v.nenashev@gmail.com (JIRA)

okunmadı,
31 Oca 2017 19:06:0131.01.2017
alıcı jenkinsc...@googlegroups.com

Pipeline is not a pure Groovy. The context is being serialized to the disk on each step to make it survive over restarts. If it something really required for temporary needs, implement the code within a method with NonCPS annotation

o.v.nenashev@gmail.com (JIRA)

okunmadı,
31 Oca 2017 19:07:0131.01.2017
alıcı jenkinsc...@googlegroups.com
Oleg Nenashev resolved as Not A Defect
 
Change By: Oleg Nenashev
Status: Open Resolved
Resolution: Not A Defect

o.v.nenashev@gmail.com (JIRA)

okunmadı,
31 Oca 2017 19:07:0131.01.2017
alıcı jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
Change By: Oleg Nenashev
Component/s: pipeline
Component/s: _unsorted

jenkins.js@crypt.se (JIRA)

okunmadı,
14 Mar 2017 03:12:0114.03.2017
alıcı jenkinsc...@googlegroups.com
Johan Svensson commented on Task JENKINS-37886
 
Re: is it possible to send email notification from a pipeline

What is the cleanest way of sending an email to all committers involved in an SCM change that triggered a pipeline where a step fails?

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo
Tümünü yanıtla
Yazarı yanıtla
Yönlendir
0 yeni ileti