Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script does not fail correctly with list of commands

Ruben Grill
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 11, 2020

When using a [list of commands](https://www.gnu.org/software/bash/manual/html_node/Lists.html), where the first command fails, the pipeline simply continues with the next script.

 

bitbucket-pipelines.yml:

 

image: python:3.8.6-alpine3.12

...

steps:

  - step

    name: test

    script:

      - set -eo pipefail

      - false && true # Does not fail

      - sh -c "false && true" # Does fail

 

How is bitbucket pipeline executing the scripts, apparently it is not equal to sth like `sh -c "..."`.

 

Real use case: `git` is not installed, the script simply ignores that:

 

Screenshot 2020-12-11 at 15.51.17.png

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events