Quantcast

link to artifacts in jenkins email

classic Classic list List threaded Threaded
5 messages Options
nns
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

link to artifacts in jenkins email

nns
Hello all!

Does anybody know the way to insert the direct links to built artifacts in email sent by Jenkins?
The issue is that the artifacts names are not static, and it's impossible to write something like
"Please see ${ENV,var="JENKINS_URL"}/job/${ENV,var="JOB_NAME"}/${ENV,var="BUILD_NUMBER"}/artifact/filename.txt"
in email body.

Is there any way to export some environment variable within the last build step or post-build task, like :
MSG_BODY=
FILELIST=`find $WORKSPACE -type f -name "*.txt"`
for file in $FILELIST
do
   MSG_BODY="$MSG_BODY $JENKINS_URL/job/$JOB_NAME/$BUILD_NUMBER/artifact/"`basename $file`
done

and then use this variable within Email-Ext plugin somehow ?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: link to artifacts in jenkins email

slide
Why is it impossible to write something like that in the email body?

On Wed, Oct 19, 2011 at 7:05 AM, nns <[hidden email]> wrote:

> Hello all!
>
> Does anybody know the way to insert the direct links to built artifacts in
> email sent by Jenkins?
> The issue is that the artifacts names are not static, and it's impossible to
> write something like
> "Please see
> ${ENV,var="JENKINS_URL"}/job/${ENV,var="JOB_NAME"}/${ENV,var="BUILD_NUMBER"}/artifact/filename.txt"
> in email body.
>
> Is there any way to export some environment variable within the last build
> step or post-build task, like :
> MSG_BODY=
> FILELIST=`find $WORKSPACE -type f -name "*.txt"`
> for file in $FILELIST
> do
>   MSG_BODY="$MSG_BODY
> $JENKINS_URL/job/$JOB_NAME/$BUILD_NUMBER/artifact/"`basename $file`
> done
>
> and then use this variable within Email-Ext plugin somehow ?
>
> Thanks in advance.
>
> --
> View this message in context: http://jenkins.361315.n4.nabble.com/link-to-artifacts-in-jenkins-email-tp3918754p3918754.html
> Sent from the Jenkins users mailing list archive at Nabble.com.
>



--
slide-o-blog
http://slide-o-blog.blogspot.com/
nns
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: link to artifacts in jenkins email

nns
Slide wrote
Why is it impossible to write something like that in the email body?
e-mail body doesn't process the scripts - it can take only env vars. But how to pass environment variables from build step to post-build email step?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: link to artifacts in jenkins email

Didier Durand
Hi,

If you don't find the appropriate plugin and don't want to write it,
you can always always add a step to you job to send an email with all
text, links and attachments that you need.

That's what I ended up doing for mail sending: I can tune it to my
exact own needs (Gmail as mail server, longer text + links to
artefacts + attachments of those artefacts)

Why  don't you go this way

regards

didier

On Oct 20, 8:11 am, nns <[hidden email]> wrote:

> Slide wrote:
>
> > Why is it impossible to write something like that in the email body?
>
> e-mail body doesn't process the scripts - it can take only env vars. But how
> to pass environment variables from build step to post-build email step?
>
> --
> View this message in context:http://jenkins.361315.n4.nabble.com/link-to-artifacts-in-jenkins-emai...
> Sent from the Jenkins users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: link to artifacts in jenkins email

pablaasmo

On 20. okt. 2011 10:39, Didier Durand wrote:
> Hi,
>
> If you don't find the appropriate plugin and don't want to write it,
> you can always always add a step to you job to send an email with all
> text, links and attachments that you need.
Yes, I can do that but I wanted to ask the list if someone had a
solution to it first.
> That's what I ended up doing for mail sending: I can tune it to my
> exact own needs (Gmail as mail server, longer text + links to
> artefacts + attachments of those artefacts)
>
> Why  don't you go this way
I do not want to go that way because it is easier to go to a web page
and see the actual info there.
When sending a mail, only the receivers of that mail can see it, and it
is more difficult to find the mail related to a certain build job later.

So we want to gather all status and info about a build in the status
page for that job.
I found the "Downstream Build View Plugin"
(https://wiki.jenkins-ci.org/display/JENKINS/Downstream+buildview+plugin) that
works for me in some way.

But I also would have seen the permalinks of the downstream jobs in the
status page also.

Regards
Per A
Loading...