The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why there is an error in your bitbucket-pipelines.yml at [definitions]. This section should be a map

Satish Kumar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 26, 2023

definitions:
- step:
name: build
script:
- &build-test |
apt-get update && apt-get install -y curl jq
RESPONSE=$(curl -sSLO -w "%{http_code}" --header "Authorization: Bearer ${ACCESS_TOKEN_LOCAL}" "https://api.bitbucket.org/2.0/repositories/pipeline-tutorial/global-variables/src/master/global-variables.yml")
echo ${RESPONSE}
HTTP_STATUS=${RESPONSE:${#RESPONSE}-3}
if [[ $HTTP_STATUS == 200 ]]; then echo "Download successful"; else echo "Download failed with HTTP status code: $HTTP_STATUS"; fi
source <(cat global-variables.yml | jq -r 'to_entries[] | "export \(.key)=\(.value | @SH)"')
pipelines:
default:
- step:
name: Build and Test
script:
- *build-test
- step:
name: Deploy
script:
- *build-test
- echo $USERNAME
- echo $EMAIL_SUBJECT

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 30, 2023

Hi @Satish Kumar and welcome to the community!

I believe the error occurs because you are missing the keyword steps in the definitions section, you can try adding it as follows:

definitions:
steps:
- step:

Make sure that the indentation is also correct. Each level should have at least 1 space indentation from the previous one, except for the levels under - step: (these should have at least 3 spaces)

Kind regards,
Theodora

0 votes
Erez Maadani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 26, 2023
TAGS
AUG Leaders

Atlassian Community Events