Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Simple Bitbucket pipeline with Bamboo

There isn't an only way to perform this, however, this is especially useful where Bamboo script task may not have support for tty. Running docker exec -it is not supported, so commands can not be passed as input to a running container. 

This example illustrates a use case where multiple services are required to perform an application test, and they can be spawned with containerization.  At the end of the test, we would like to parse the result.

Step 1: 

Create the executable script in a location in the repository. The script should contain the necessary instruction to run and perform the test for the project 


#script goes here i.e.
npm install

npm run test

Step 2:

Create a Dockerfile with an ENTRYPOINT of a script to be run in when the container is started 



# Copy all project into the container working directory
COPY . ./app

#make the script an executable
RUN chmod a+x

#Specify the interpreter to run the script
ENTRYPOINT ["/bin/sh", "" ]

Step 3:

Create a docker-compose.yml to orchestrate the container and required services

version: "3.7"


mage: webapp
container_name: C-NAME
context: ./
dockerfile: Dockerfile

# map the volume to the host filesystem, this will be useful if a test
# run by the script produces result that should be parsed by a Bamboo task

- ./test:/app/test-reports

# add the required services
image: IMAGE

Step 4:
Example of a Bamboo YAML Specs managed plan
version: 2

# List of plan's stages and jobs
- Building to run the custom test within docker container:
- Build
- Parse Test Results:
- Test

#Job definition
- script:
- docker-compose up -d
- script:
- docker-compose down
- test-parser:
type: junit
test-results: '**/test/*.xml'




Log in or Sign up to comment
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,085 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you