Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

chuongtran
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 30, 2019

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
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2019

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
AUG Leaders

Atlassian Community Events