Information Technology Reference
In-Depth Information
LISTING 9-2
Sending a Text Message from CruiseControl When the
Build Fails
<publishers>
<email mailhost="
smtp.mydomain.com
"
returnaddress
=buildstatus@mydomain.com
defaultsuffix=@mydomain.com
returnname="Project Build Status"
spamwhilebroken="false"
buildresultsurl="SMS">
<failure address="
7035551212@mobilephone-emailaddress.com
"
reportWhenFixed="true"/>
</email>
</publishers>
Here's a short explanation of Listing 9-2 as well as some other options
you can use with SMS.
•
smtp.mydomain.com
should be replaced with your SMTP
server. You may also need to specify credentials to send e-mail
through your SMTP server; in this case, use the
username
and
password
attributes.
•The
returnaddress
attribute identifies the return e-mail address
that appears in the e-mail's from field.
• The text
@mydomain.com
in the default suffix attribute should be
replaced with your domain name.
• This uses a
<failure>
child element to always send failure mes-
sages to a specified e-mail address. The value
7035551212@mobilephone-emailaddress.com
should be
replaced with the e-mail address you would like your build fail-
ures to be sent to. The
reportWhenFixed
attribute is set to
true
to send a follow-up e-mail to indicate when a build has been
fixed.
• CruiseControl permits the use of the
xslfile
attribute, which
eliminates the need for
css
and
xslDir
attributes.
You may want to receive a text message every time the build suc-
ceeds or fails. However, I prefer to receive a text message only when
the build fails, and then once when the fixed build succeeds. We have
many builds per day, and I do not want a flurry of text messages when
no action is required (i.e., a successful build).