Re: Add Publisher Maven artifacts to mail template

2019-04-26 Thread Harsh Shah
Hi, Cyrille

  So this is how I do it.


pipeline side invoke the method
 
env.DEPLOYEDARTIFACTS = getDeployedArtifacts()

@NonCPS
def getDeployedArtifacts() {
def deployed = ''
Collection 
generatedArtifacts = 
currentBuild.rawBuild.getAction(org.jenkinsci.plugins.pipeline.maven.publishers.MavenReport.class).getGeneratedArtifacts();
for (org.jenkinsci.plugins.pipeline.maven.MavenArtifact 
generatedArtifact:generatedArtifacts) {
if (generatedArtifact.isDeployed()) {
   
deployed= deployed.concat(generatedArtifact.getUrl())
deployed = deployed.concat("===")
deployed = deployed.concat(generatedArtifact.getShortDescription())
deployed = deployed.concat(",") 
}

}
return deployed
}



In EXT-MAIL-STANDARD-TEMPLATE 




Deployed Artifacts
 

   


 
  
  

${artifact[1]}
  
  
   
 
 
   
 



 


On Monday, April 22, 2019 at 3:22:34 AM UTC-7, Cyrille Le Clerc wrote:
>
> Thanks Harsh,
>
> Could you please share with us an example of using maven pipeline details 
> in email generated by the email ext plug-in that I would add to the 
> documentation?
>
> Le lun. 22 avr. 2019 à 08:49, Harsh Shah > 
> a écrit :
>
>> Collection 
>> generatedArtifacts = 
>> currentBuild.rawBuild.getAction(org.jenkinsci.plugins.pipeline.maven.publishers.MavenReport.class).getGeneratedArtifacts();
>> for 
>> (org.jenkinsci.plugins.pipeline.maven.MavenArtifact 
>> generatedArtifact:generatedArtifacts) {
>> if (generatedArtifact.isDeployed()) {
>> println("" + generatedArtifact.getShortDescription() 
>> + "");
>> } else {
>> 
>> println(generatedArtifact.getShortDescription());
>> }
>> }
>>
>> On Sunday, April 21, 2019 at 11:48:03 PM UTC-7, Harsh Shah wrote:
>>>
>>> Hi,
>>>   Thanks, this works.
>>>
>>> -Harsh
>>>
>>> On Sunday, April 21, 2019 at 9:15:50 AM UTC-7, Cyrille Le Clerc wrote:
>>>>
>>>> Hello Harsh,
>>>>
>>>>
>>>> This seems to be possible but I have not tried. It should look like:
>>>>
>>>> Collection 
>>>> generatedArtifacts = build.getAction(org.jenkinsci.plugins.pipeline.
>>>> maven.publishers.MavenReport.class).getGeneratedArtifacts();
>>>>
>>>> for (MavenArtifact generatedArtifact:generatedArtifacts) {
>>>> if (generatedArtifact.isDeployed()) {
>>>> System.out.println("" + generatedArtifact.getShortDescription() + "");
>>>> } else {
>>>> System.out.println(generatedArtifact.getShortDescription());
>>>> }
>>>> }
>>>>
>>>>
>>>> See source code 
>>>> https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.6.9/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenArtifact.java
>>>>
>>>> Cyrille
>>>>
>>>> On Friday, April 19, 2019 at 7:06:01 PM UTC+2, Harsh Shah wrote:
>>>>>
>>>>> The template is a pretty standard template like this 
>>>>> https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1=1332562186000=v2
>>>>> I am trying to get maven artifacts urls
>>>>>
>>>>> 
>>>>> 
>>>>> 
>>>>>   
>>>>> Build Artifacts
>>>>> 
>>>>>       ${m.key.displayName}
>>>>>   
>>>>> 
>>>>> 
>>>>>   
>>>>> 
>>>>>   
>>>>> >>>> href="${rooturl}${mvnbld.url}artifact/${f}">${f}
>>>>>   
>>>>> 
>>>>>   
>>>>> 
>>>>>   
>>>>> 
>>>>> 
>>>>>   
>>>>> 
>>>>>
>>>>>
>>>>>
>>>>> On Friday, April 19, 2019 at 9:30:49 AM UTC-7, Cyrille Le Clerc wrote:
>>>>>>
>>>>>> do you have examples of i

Re: Add Publisher Maven artifacts to mail template

2019-04-22 Thread Harsh Shah
Collection 
generatedArtifacts = 
currentBuild.rawBuild.getAction(org.jenkinsci.plugins.pipeline.maven.publishers.MavenReport.class).getGeneratedArtifacts();
for (org.jenkinsci.plugins.pipeline.maven.MavenArtifact 
generatedArtifact:generatedArtifacts) {
if (generatedArtifact.isDeployed()) {
println("" + generatedArtifact.getShortDescription() 
+ "");
} else {

println(generatedArtifact.getShortDescription());
}
}

On Sunday, April 21, 2019 at 11:48:03 PM UTC-7, Harsh Shah wrote:
>
> Hi,
>   Thanks, this works.
>
> -Harsh
>
> On Sunday, April 21, 2019 at 9:15:50 AM UTC-7, Cyrille Le Clerc wrote:
>>
>> Hello Harsh,
>>
>>
>> This seems to be possible but I have not tried. It should look like:
>>
>> Collection 
>> generatedArtifacts = build.getAction(org.jenkinsci.plugins.pipeline.maven
>> .publishers.MavenReport.class).getGeneratedArtifacts();
>>
>> for (MavenArtifact generatedArtifact:generatedArtifacts) {
>> if (generatedArtifact.isDeployed()) {
>> System.out.println("" + generatedArtifact.getShortDescription() + "");
>> } else {
>> System.out.println(generatedArtifact.getShortDescription());
>> }
>> }
>>
>>
>> See source code 
>> https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.6.9/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenArtifact.java
>>
>> Cyrille
>>
>> On Friday, April 19, 2019 at 7:06:01 PM UTC+2, Harsh Shah wrote:
>>>
>>> The template is a pretty standard template like this 
>>> https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1=1332562186000=v2
>>> I am trying to get maven artifacts urls
>>>
>>> 
>>> 
>>> 
>>>   
>>> Build Artifacts
>>> 
>>>   ${m.key.displayName}
>>>   
>>> 
>>> 
>>>   
>>> 
>>>   
>>> >> href="${rooturl}${mvnbld.url}artifact/${f}">${f}
>>>   
>>>     
>>>   
>>> 
>>>   
>>> 
>>> 
>>>   
>>> 
>>>
>>>
>>>
>>> On Friday, April 19, 2019 at 9:30:49 AM UTC-7, Cyrille Le Clerc wrote:
>>>>
>>>> do you have examples of integrations of the email ext plugin with other 
>>>> plugins?
>>>> Is the integration based on environment variables?
>>>>
>>>> Cyrille
>>>>
>>>> On Friday, April 19, 2019 at 2:15:11 AM UTC+2, Harsh Shah wrote:
>>>>>
>>>>> Hi,
>>>>>   We have been using pipeline maven plugin and maven artifact 
>>>>> publisher to display deployed artifacts by the build. 
>>>>>
>>>>>   We also use ext-email plugin with a template to provide 
>>>>> notifications. 
>>>>>
>>>>> How can I get the published maven artifacts from maven artifact 
>>>>> publisher in my email description?
>>>>>
>>>>>  
>>>>> Thanks,
>>>>> -Harsh
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f4ea394b-824e-4ba7-8664-46b205bb523d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Add Publisher Maven artifacts to mail template

2019-04-22 Thread Harsh Shah
Hi,
  Thanks, this works.

-Harsh

On Sunday, April 21, 2019 at 9:15:50 AM UTC-7, Cyrille Le Clerc wrote:
>
> Hello Harsh,
>
>
> This seems to be possible but I have not tried. It should look like:
>
> Collection 
> generatedArtifacts = build.getAction(org.jenkinsci.plugins.pipeline.maven.
> publishers.MavenReport.class).getGeneratedArtifacts();
>
> for (MavenArtifact generatedArtifact:generatedArtifacts) {
> if (generatedArtifact.isDeployed()) {
> System.out.println("" 
> + generatedArtifact.getShortDescription() + "");
> } else {
> System.out.println(generatedArtifact.getShortDescription());
> }
> }
>
>
> See source code 
> https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.6.9/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/MavenArtifact.java
>
> Cyrille
>
> On Friday, April 19, 2019 at 7:06:01 PM UTC+2, Harsh Shah wrote:
>>
>> The template is a pretty standard template like this 
>> https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1=1332562186000=v2
>> I am trying to get maven artifacts urls
>>
>> 
>> 
>> 
>>   
>> Build Artifacts
>> 
>>   ${m.key.displayName}
>>   
>> 
>> 
>>   
>> 
>>   
>> > href="${rooturl}${mvnbld.url}artifact/${f}">${f}
>>   
>> 
>>   
>> 
>>   
>> 
>> 
>>   
>> 
>>
>>
>>
>> On Friday, April 19, 2019 at 9:30:49 AM UTC-7, Cyrille Le Clerc wrote:
>>>
>>> do you have examples of integrations of the email ext plugin with other 
>>> plugins?
>>> Is the integration based on environment variables?
>>>
>>> Cyrille
>>>
>>> On Friday, April 19, 2019 at 2:15:11 AM UTC+2, Harsh Shah wrote:
>>>>
>>>> Hi,
>>>>   We have been using pipeline maven plugin and maven artifact publisher 
>>>> to display deployed artifacts by the build. 
>>>>
>>>>   We also use ext-email plugin with a template to provide 
>>>> notifications. 
>>>>
>>>> How can I get the published maven artifacts from maven artifact 
>>>> publisher in my email description?
>>>>
>>>>  
>>>> Thanks,
>>>> -Harsh
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b690c83c-f461-4107-a40f-3e085d2ffd0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: withMaven Artifacts URL

2019-04-19 Thread Harsh Shah
Any update on the API to get the published artifacts url into a variable? 
I want to use the generated URL in mail description.

This topic has a similar 
need, https://groups.google.com/forum/#!topic/jenkinsci-users/sPAYLh1W1cM

Thanks.

On Monday, August 13, 2018 at 6:03:19 PM UTC-7, Bernardo Vale wrote:
>
> Hey guys.
>
> I'm looking for a way to programmatically determine the URL of an artifact 
> generated by withMaven (Maven Pipeline Plugin).
>
> When I deploy an artifact using withMaven, it generates the URL of each 
> artifact inside: $JENKINS_SERVER/path/to/job/8/maven
>
> I'd like to programmatically consume this information.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/81cedacd-441c-4f8e-86d2-450693111cad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Add Publisher Maven artifacts to mail template

2019-04-19 Thread Harsh Shah
The template is a pretty standard template like this 
https://wiki.jenkins.io/download/attachments/3604514/jenkins-matrix-email-html.template?version=1=1332562186000=v2
I am trying to get maven artifacts urls




  
Build Artifacts

  ${m.key.displayName}
  


  

  
${f}
  

  

  


  




On Friday, April 19, 2019 at 9:30:49 AM UTC-7, Cyrille Le Clerc wrote:
>
> do you have examples of integrations of the email ext plugin with other 
> plugins?
> Is the integration based on environment variables?
>
> Cyrille
>
> On Friday, April 19, 2019 at 2:15:11 AM UTC+2, Harsh Shah wrote:
>>
>> Hi,
>>   We have been using pipeline maven plugin and maven artifact publisher 
>> to display deployed artifacts by the build. 
>>
>>   We also use ext-email plugin with a template to provide notifications. 
>>
>> How can I get the published maven artifacts from maven artifact publisher 
>> in my email description?
>>
>>  
>> Thanks,
>> -Harsh
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/70d2ed27-0034-45d4-a478-58c88f8f3c8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Add Publisher Maven artifacts to mail template

2019-04-18 Thread Harsh Shah
Hi,
  We have been using pipeline maven plugin and maven artifact publisher to 
display deployed artifacts by the build. 

  We also use ext-email plugin with a template to provide notifications. 

How can I get the published maven artifacts from maven artifact publisher 
in my email description?

 
Thanks,
-Harsh

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/127d2368-aadd-4b2d-96e3-a1f8df7f2c59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [withMaven] maven linker publisher stop working after upgrade to latest LTS 2.164.1

2019-03-26 Thread Harsh Shah
I am facing a similar issue. 

Thanks,
-H

On Tuesday, March 26, 2019 at 5:03:02 PM UTC-7, Dan Tran wrote:
>
>
> Hello 
>
> Anyone facing the same issue? downgrade pipeline maven plugin to 3.6.5 
> still not helping
>
> Thanks
>
> -D
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/59c6c410-f8f7-449d-9bcd-fc4f4202939a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.