Can I write a script command on multiple lines with Bitbucket Pipelines?

Sten Pittet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2016

I have a long command and I'd like to break it down across multiple lines. Can I do that in my bitbucket-pipelines.yml configuration?

2 answers

1 accepted

8 votes
Answer accepted
Sten Pittet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2016

Yes you can, by using block scalar styles with the folded style.

The example below shows you how to write a script command across multiple lines.

pipelines:
  default:
    - step:
        script:  # The command below is broken down in multiple lines
          - >
            ls -lh
            && pwd

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events