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

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

Invalid script section on yaml anchor

Edited

Hi,

 

I've been trying to figure out how to fix my issue in bitbucket pipelines. I had the same issue in the past but never figured out how I was able to resolved it (feels like a cache reset somewhere...). Whatsoever, the following yaml gives me the following error:


No commands or pipes defined for the step at [pipelines > branches > bitbucket-p

ipeline-test > 1 > step]. Check that you have defined a valid "script" section.

 

The yaml is valid through the bitbucket-pipeline validator, I tried to change the indentation at various places , but I still face the same problem

# Build configuration for Project
# -----
image: node:12

definitions:
pipes:
- pipe: &AWSCodeDeployUploadPipe
pipe: atlassian/aws-code-deploy:0.6.0
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
COMMAND: upload
DEPLOYMENT_GROUP: $AWS_DEPLOYMENT_GROUP
S3_BUCKET: $AWS_S3_BUCKET
ZIP_FILE: codedeploy-artifact.zip

- pipe: &AWSCodeDeployDeployPipe
pipe: atlassian/aws-code-deploy:0.6.0
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
COMMAND: deploy
DEPLOYMENT_GROUP: $AWS_DEPLOYMENT_GROUP
S3_BUCKET: $AWS_S3_BUCKET

steps:
- step: &BuildTestPackageStep
name: Build and Test
script:
- npm ci
- npm test
- npm run build
artifacts:
- '**'

- step: &UploadDeployAWSStep
deployment: integration
name: Upload and Deploy to AWS
image: atlassian/default-image:2
script:
- /bin/bash generateCodeDeployArtifact.sh
- *AWSCodeDeployUploadPipe
- *AWSCodeDeployDeployPipe

pipelines:
branches:
bitbucket-pipeline-test:
- step: *BuildTestPackageStep
- step:
≤≤: *UploadDeployAWSStep
name: test

 If I change the last section to the following it works... but I'm losing the flexibility to change the deployment environment ;) :

pipelines:
branches:
bitbucket-pipeline-test:
- step: *BuildTestPackageStep
- step: *UploadDeployAWSStep

Thanks for the help!

1 answer

1 accepted

0 votes
Answer accepted

Fix:

I can't believe it was that simple. My keyboard language changed by inadvertence and the symbol  "≤" was at the same place as my usual "<" ... My eyes just went over that small detail.

Replacing it with the correct character fixed the issue...

The bitbucket pipeline validator didn't catch that issue due to the following bug: https://jira.atlassian.com/browse/BCLOUD-18299

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🎨 Add some visual life to your templates

Hi Atlassian Community, My name is Avni Barman, and I am a Product Manager on the Confluence Cloud team. Based on feedback from you, we are giving admins more power to create templates that a...

119 views 1 4
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