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

Errors writing first pipelines script

Cameron August 22, 2023

Hi, I'm trying to write my first bitbucket pipelines script to build and deploy code on jboss eap server. What I have so far is:

pipelines.PNG

I have 2 questions:

1. Will this build then deploy my code successfully

2. On line 24 I get "bad indentation of mapping entry line 24 column 12" Which is toward the end of variables between the word and : 

Any help would be greatly appreciated

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2023

Hey @Cameron and thank you for reaching out to Community!

It seems like the syntax you have used is invalid. I've adjusted the formatting of your YML file to fix the indentation, which you can find below : 

image: maven:3.6.3

pipelines:
default:
     - step:
        name: Build and Test
        caches:
         - maven
        script:
          - mvn -B verify - - file pom.xml
        after-script:
           # Collect checkstyle results, if any, and convert to Bitbucket code Insights.
          - pipe: atlassian/checkstyle-report:0.3.0
     - step:
        name: Deploy
        script:
          - pipe: atlassian/scp-deploy:1.3.0
            variables:
             USER: '$BAMBOO _USER'
             SERVER: '$DEV_SERVER'
             REMOTE PATH: '/home/bamboo'
             LOCAL_PATH: '$(BITBUCKET_CLONE_DIR)/**'
          - pipe:  atlassian/ssh-run:0.5.0
            variables:
             SSH_USER: '$BAMBOO_USER'
             SSH_PASS: '$BAMBOO_PASS'
             SERVER: '$DEV_SERVER'
             COMMAND: '<Command to run in the destination server>'

You can try running the pipeline with the yml above and let us know how it goes.

For future reference, to validate the syntax/indentation of your YML file before pushing it to your repository, you can use the Bitbucket Pipelines Validator.

Thank you, @Cameron !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events