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

Write if, else condition in bamboo yaml file

I have the snippet of code in my bamboo yaml 

- script:
interpreter: /bin/sh

- GIT_BRANCH=${bamboo_planRepository_branch}
- BASE_VERSION=$(date +%g.%m)
- BUILD_VERSION="${BASE_VERSION}.${bamboo_buildNumber}"
- TAG_LATEST="false"

if [ "${GIT_BRANCH}" == "master" ]; then
log "Master branch - build main version"

but im getting the below error, can some one help what is the issue in this code

Error Message: home/bamboo/bamboo-agent-home/temp/ 12: /home/bamboo/bamboo-agent-home/temp/ Syntax error: "then" unexpected (expecting "fi")


1 answer

1 accepted

0 votes
Answer accepted

Hello @Nagomi, Welcome to Atlassian Community!

Just add a fi below the "log" line and it will pass.


Eduardo Alvarenga
Atlassian Support APAC

Yep. Thanks worked edurado.


By the way is it possible to create two plans from a single yaml file

Hello @Nagomi

Yes, it is. Please check this thread for more information.

Please don't forget to mark this answer as an Accepted Solution. Marking a reply as a solution will make it easier for others who have a similar issue to find it in the future.

Eduardo Alvarenga
Atlassian Support APAC

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

963 views 3 8
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