Our query is regrading Bitbucket pipeline.
We have defined steps(install,build,test and deply) in a stage under definition. Now under pipelines -> branches we want it to be called/re-use. But seems branches requires steps only because we are getting following error while triggering the pipeline:
There is an error in your bitbucket-pipelines.yml at [pipelines > branches > {develop,staging} > 0 > stage > steps > 0]. The step section is empty or null.
Pipeline code for reference:
# Default base image : pipeline wideimage: node:15.1.0-alpine
# pipeline wide definationsdefinitions:# stage - to group different steps of processstage: &install-test-build-deployname: install-test-build-deployruns-on:- self.hosted- linux.shellcaches:- nodeartifacts:- build/**steps:- parallel:steps:- step: &lintname: Lintscript:# Run your linter of choice here- npm install eslint- step: &installname: installscript:- npm install
- step: &buildname: buildscript:- npm run build
- step: &testname: testscript:- npm run test
- step: &deployname: deployscript:# update s3 bucket with latest changes via sync command- aws s3 sync --delete build s3://${BUCKET}
# update cdn content by creating invalidation- aws cloudfront create-invalidation --distribution-id ${DIST} --paths "/*"
# Pipeline workflow Configurationpipelines:default:- step:<<: *lintbranches:'{staging}':- step:<<: *install-test-build-deploydeployment: staging'{qa}':- stage:<<: *install-test-build-deploydeployment: qa'{production}':- stage:<<: *install-test-build-deploydeployment: production# trigger: manual
Please guide...
stages:
# stage - to group different steps of process
- stage: &install-test-build-deploy
definitions:
stages:
# stage - to group different steps of process
- stage: &install-test-build-deploy
name: install-test-build-deploy
steps:
- step: &lint
name: Lint
runs-on:
- self.hosted
- linux.shell
script:
# Run your linter of choice here
- npm install eslint
caches:
- node
artifacts:
- build/**
- step: &install
name: install
runs-on:
- self.hosted
- linux.shell
script:
- npm install
- step: &build
name: build
runs-on:
- self.hosted
- linux.shell
script:
- npm run build
- step: &test
name: test
runs-on:
- self.hosted
- linux.shell
script:
- npm run test
- step: &deploy
name: deploy
runs-on:
- self.hosted
- linux.shell
script:
# update s3 bucket with latest changes via sync command
- aws s3 sync --delete build s3://${BUCKET}
# update cdn content by creating invalidation
- aws cloudfront create-invalidation --distribution-id ${DIST} --paths "/*"
Kind regards,
Theodora
Thank you Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.