The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events