Once you have created and configured your new deployment project and deployment environments, you can set up associated tasks for the deployment process. Bamboo allows you to execute a range of different tasks upon deployment including:
- Bash and other shell commands
- Bespoke written scripts
- SCP, SSH and Artifact handler tasks
- Ant executables
- Maven 1.x, 2.x & 3.x executables
- Tomcat executables
- Heroku deployments
On this page:
Adding an environment task
Tasks may be added to a deployment environment during or after the environment creation process; tasks may also be edited and changed afterwards as well.
To add a task to a deployment environment:
- Open your deployment project and expand the relevant environment panel. Under 'How you want to deploy', click on the Edit tasks button. The 'Set up tasks' screen will display. The Clean working directory and Artifact download tasks are included by default:
- From the Set up tasks screen, click on the Add Task button. The 'Task type' selection window will display:
Click on the task type that you want to use. Only tasks applicable to the deployment environment will be available for selection. The task configuration window will open, and you can configure the task according to the needs of your deployment project. Different tasks will have different requirements
Remember that capability and requirement matching is still in effect for deployment environments. If your task does not have the right capabilities it will not be executed, even if the relationship has been defined.
- Click on the Save button to save your task configuration. The Setup tasks screen will display again. Your newly configured task will display in the left side of the pane
- Click on the Add Task button to add additional tasks to your environment and complete the above process again
- When all of the tasks have been set up, click on Back to deployment project to return to the deployment project page.
Some useful deployment tasks
Deploying with Tomcat
You can use Bamboo to deploy and manage your Java web application with Tomcat 6 or 7, without having to directly interact with Maven, Ant or write special scripts.
See Using Tomcat with Bamboo for continuous deployment.
Copying and moving files with SCP
You can use the Bamboo SCP task to upload files from Bamboo directly to a remote server as part of a Bamboo job. The SCP task is able to copy multiple files and preserves the directory structure for the copied files.
See Using the SCP task in Bamboo.
Integrating with Heroku
You can use Bamboo to deploy your Java web application to the Heroku cloud platform.
See Using the Heroku task in Bamboo.
Deploying ASP.NET applications with MSDeploy
msdeploy.exe.Assigning a final task
Once all of your tasks have been configured, you may assign some or all of them to be Final Tasks. Final Tasks are always executed at the end of the build.
To assign a final task:
- Open your deployment project and expand the relevant environment panel. In the Other settings section, click on the Tasks button to display the 'Set up tasks' screen.
- To make a task a Final Task, simply drag the task beneath the Final Task bar in the Setup tasks window:
- Click on Back to deployment project to return to the deployment project page.
Editing an environment task
If you have already added some tasks to an environment, then they can be easily changed at a later stage. To edit environment tasks:
- Open your deployment project and expand the relevant environment panel. Click on Edit tasks. The 'Setup tasks' screen will appear.
- Existing tasks can be edited by clicking on the task in the left hand pane of the setup window
- New tasks can be added by clicking on the Add Task button and following the process described in the above section
- Unwanted tasks can be deleted from the environment by clicking on the cross icon belonging to the task.



7 Comments
Jeremy Goodwin
Jun 10, 2013For deploying a cloud service with Windows Azure, see this http://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/ and then hook up an appropriate bamboo script to call powershell.
Michael Donat
Sept 11, 2013And even though it makes a point about standard capability selection, remember that you can't choose your own custom one.
Christian Crews
Oct 10, 2013When my powershell script fails, bamboo reports that it has passed regardless of writing the error to the host. Do you know what I have to do to get bamboo to report a build failure when a powershell scipt command task fails?
Jeremy Goodwin
Oct 10, 2013Christian, you need to set your powershell script to generate an appropriate exit code. For example I use this script to stop a given Windows service via bamboo:
param($process) Write-Host "Attempting to stop process '$process'" $proc = Get-Process -Name $process -ErrorAction SilentlyContinue if ($proc -ne $null) { Stop-Process $proc.Id Write-Host "Stopping process" while (!$proc.HasExited) { Write-Host $proc.StandardOutput.ReadLineAsync() -ErrorAction SilentlyContinue } Write-Host "Process stopped" } else { Write-Host "Process doesn't exist" exit 0 }The exit 0 will allow Bamboo to pick up that the command has failed.
Christian Crews
Oct 10, 2013Thanks for your input JGoodwin, but my failing ps script still leads to a passing bamboo task. I've tried try/catch/throw. I've tried trap. So far, my task are still incorrectly passing..
Manuel Mall
Oct 13, 2013Our development, build and deploy, and target environments are all Linux based with one exception. We manage database versioning using RoundhousE which is a Windows application. Initially I thought: not a problem - just have a Windows based agent running this. But, deployment projects, different to Build Plans, don't have jobs that can be passed to a particular agent. So what can I do if I want just one particular deployment task to be executed in a Windows environment while everything else runs under Linux?
Rafał Łyczkowski
Jul 16, 2014What makes the deployment flagged as succeded?
Do particulary deployment tasks return something?
Should I reveive any of success parameter after processing?
For example:
I want to deploy my project after a successfull build by remote SSH command which will checkout latest code. But in these approach I feel that I should receive success msg from git return and provide it to the deployment task which will flag it pos/neg.
exit 0; is the answer? Is this the only posibillity to "send message" to bamboo that deploy fails?