It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

There is a YAML syntax error in your bitbucket-pipelines.yml

Hi,

My bitbucket-pipeline.yml like that and I checked on Validator is valid but I facing issue YAML syntax error when running pipeline.

Screenshot at May 30 16-17-42.png

Thank you support.

There is a YAML syntax error in your bitbucket-pipelines.yml at [line 3, column 13]. To be precise: expected a mapping or list of mappings for merging, but found scalar

definitions: 
steps:
- step: &build-web
name: Build web & Zip server
image: atlassian/default-image:2
deployment: aws_dev
script:
- npm config set user 0
- npm config set unsafe-perm true
- npm run install:web
- node scripts/write-build-web-app.js $BITBUCKET_BRANCH $BITBUCKET_COMMIT $BUILD_ENV
- npm run build:$BUILD_ENV
- node scripts/write-build-server.js $BITBUCKET_BRANCH $BITBUCKET_COMMIT $BUILD_ENV
- zip -r application.zip Dockerfile Dockerrun.aws.json server -x "*test*" "*db_script*" "*docker*"
artifacts:
- dist/**
- application.zip
- step: &deploy
name: "Deploy web-app & server"
image: atlassian/default-image:2
deployment: aws_dev
script:
- npm config set user 0
- npm config set unsafe-perm true
- npm install
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.9
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: $AWS_APPLICATION_NAME
ENVIRONMENT_NAME: $AWS_ENVIRONMENT_NAME
ZIP_FILE: "application.zip"
WAIT: "true"
DEBUG: "true"
DELETE_FLAG: "true"
- pipe: atlassian/aws-s3-deploy:0.2.4
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: $S3_BUCKET
LOCAL_PATH: "dist"
after-script:
# send email notification success
- node scripts/send-mail-deployed.js $BITBUCKET_BRANCH $BITBUCKET_COMMIT $BUILD_ENV $SENDGRID_API_KEY

pipelines:
custom:
1-aws-fraser-dev:
- step:
<<: *build-web
deployment: aws_dev
- step:
<<: *deploy
deployment: aws_dev

 

1 answer

1 vote

Hello,

This could potentially be a formatting issue. I'm not 100% on the formatting that you used, as it didn't copy into the code block properly. However, I got the configuration to successfully parse with the following indentation:

definitions:
steps:
- step: &build-web
name: Build web & Zip server
image: atlassian/default-image:2
deployment: aws_dev
script:
- npm config set user 0
- npm config set unsafe-perm true
- npm run install:web
- node scripts/write-build-web-app.js $BITBUCKET_BRANCH $BITBUCKET_COMMIT $BUILD_ENV
- npm run build:$BUILD_ENV
- node scripts/write-build-server.js $BITBUCKET_BRANCH $BITBUCKET_COMMIT $BUILD_ENV
- zip -r application.zip Dockerfile Dockerrun.aws.json server -x "*test*" "*db_script*" "*docker*"
artifacts:
- dist/**
- application.zip
- step: &deploy
name: "Deploy web-app & server"
image: atlassian/default-image:2
deployment: aws_dev
script:
- npm config set user 0
- npm config set unsafe-perm true
- npm install
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.9
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: $AWS_APPLICATION_NAME
ENVIRONMENT_NAME: $AWS_ENVIRONMENT_NAME
ZIP_FILE: "application.zip"
WAIT: "true"
DEBUG: "true"
DELETE_FLAG: "true"
- pipe: atlassian/aws-s3-deploy:0.2.4
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
S3_BUCKET: $S3_BUCKET
LOCAL_PATH: "dist"
after-script:
# send email notification success
- node scripts/send-mail-deployed.js $BITBUCKET_BRANCH $BITBUCKET_COMMIT $BUILD_ENV $SENDGRID_API_KEY

pipelines:
custom:
1-aws-fraser-dev:
- step:
<<: *build-web
deployment: aws_dev
- step:
<<: *deploy
deployment: aws_dev

See how that goes for you.

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,042 views 0 3
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