-1

Trying to ctreate pipeline for 2 brances but got configiration error

Configuration error There is an error in your bitbucket-pipelines.yml at [pipelines > branches > staging > 1]. To be precise: Step is empty, null, or missing.

Validate your bitbucket-pipelines.yml View bitbucket-pipelines.yml

image: node:14
definitions:
  steps:
    - step: &build
       caches:
       - node
       script: 
       - npm install 
       
    - step: &deploy
        name: Deploy to server
        script:
          - echo "Deploying to production environment"
          - pipe: atlassian/ssh-run:0.2.2
            variables:
              SSH_USER: 'ubuntu'
              SERVER: $SERVER_IP
              COMMAND: '/home/ubuntu/backend/cyan/deployment.sh'

pipelines:
  branches:
    staging:
      - step: *build
      - step:
        <<: *deploy
        name: Deploy to production
        deployment: staging
    production:
      - step: *build
      - step:
        <<: *deploy
        name: Deploy to production
        deployment: production

I would appreciate any help since I just started using bitbucket pipelines.

1 Answers1

0
pipelines:
  branches:
    staging:
      - step: *build
      - step:
          <<: *deploy
          name: Deploy to production
          deployment: staging
    production:
      - step: *build
      - step:
          <<: *deploy
          name: Deploy to production
          deployment: production
  • 1
    Did this solve your problem? If so, can you [edit] your answer to explain what changed? That will be useful to future readers. – Jeremy Caney Mar 30 '22 at 00:38