0

When I run a Concourse pipeline with a nested Python script inside of the run param like so:

- task: some-task
    params:
      ...
    config:
      platform: linux
      ...
      run:
        path: bash
        args:
        - "-c"
        - |

          python my_failing_python_code.py

When the python script fails, throwing an exit 1, the error does not seem to bubble up to the pipeline like I would expect. Overall the pipeline ends "successfully".

How should I set up my pipeline to read the exit status of a script run within the pipeline?

Thanks

Austin L
  • 336
  • 1
  • 17

1 Answers1

1

If that is the whole content of the script, then you can replace it with

run:
        path: python
        args:
        - my_failing_python_code.py

See https://concourse-ci.org/hello-world-example.html

if the shell script does also other things, you are missing a set -e, to tell the shell to report an error:

    run:
        path: bash
        args:
        - "-c"
        - |
          set -e
          python my_failing_python_code.py

See https://concourse-ci.org/tasks.html

marco.m
  • 4,573
  • 2
  • 26
  • 41
  • There is more to the script, I run some bash setup then invoke the python script. I will implement the `set -e` and report back. Thank you! – Austin L Feb 05 '20 at 16:06