Bamboo deploy to local folder and sucess email setup help needed
Asked by Darren Clark Clark:

We have part of our babmoo setup working, but i cannot work out the last bit!

Steps are

1) Get from repos - Done

2) Build .NET project using visual studio build - done

3) Label repos that a build has taken place

4) Copy successful build to shared folder or even local folder for that matter - HOW DO I DO THAT????

5) Email team sucess email with list of JIRA tasks that were complete - HOW DO I DO THAT?

ANy help we can get would be awesome.

Thanks


Answers:
author: Gretchen
body: For the email, we call a vbs script which contains other information than what the build success email sends. This includes where to get the code to deploy, location of a report we produce, the branch/tag and some other information required by our client.

It looks like this:

```
Dim tag, branch, deploymentLoc, sigLine, bodyLinetag = WScript.Arguments(1)branch = WScript.Arguments(2)deploymentLoc = WScript.Arguments(3)sigLine = WScript.Arguments(4)reportloc=Wscript.Arguments(5)bodyLine = (tag) &amp; vbcrlf &amp; (branch) &amp; vbcrlf &amp; (deploymentLoc) &amp; vbcrlf &amp; (reportloc) &amp; vbcrlf &amp; vbcrlf &amp; vbcrlf &amp; (sigLine)Set objMessage = CreateObject("CDO.Message")objMessage.Subject = WScript.Arguments(0)objMessage.From = "fromaddress@domain.com"objMessage.To = "groupaddress@domain.com"objMessage.TextBody = bodyLine'==This section provides the configuration information for the remote SMTP server.'==Normally you will only change the server name or IP.objMessage.Configuration.Fields.Item _("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2'Name or IP of Remote SMTP ServerobjMessage.Configuration.Fields.Item _("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.your_mailserver.com"'Server port (typically 25)objMessage.Configuration.Fields.Item _("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25objMessage.Configuration.Fields.Update'==End remote SMTP server configuration section==objMessage.Send
```

Then we pass in all the args referenced in the top


author: Paul B
body: for #3, "Copy successful build",

what we do is we configure all important build result files as artifact.  
then in a 'dependent' build we run a script that uses something like this:

wget <http://bamboo.mycompany.com/browse/PRJKEY-BLDKEY/latest/artifact/JOB1/myartifactnamedir/myartifactfile.tgz>

and I guess this script could also use a command line mailer to mail build results when this 'wget' completes.

or I you could define an environment variable in your task like this:

buildsrcdir=${bamboo.build.working.directory}

then in a task script or build script you could copy things

cp $buildsrcdir/mybuiltfile /some/new/location

I also have certain builds send mail when they are done (Notification = All Jobs Completed) and in order to add site specific info, from the build script, I echo to stderr and the echo message is in the build result email.

echo "Build directory: $buildsrcdir" \> /dev/stderr

echo "Release directory: /some/new/dir" \> /dev/stderr

[https://answers.atlassian.com/questions/148547/add-build-information-to-the-successful-build-email](/questions/148547/add-build-information-to-the-successful-build-email)


Tags: bamboo-administration