Hey all. I have a pre-workflow script that runs t...
# atlantis-community
j
Hey all. I have a pre-workflow script that runs that does some packer stuff before my atlantis plan/apply cycle happens. Sometimes that fails with an error, and the step in github still shows that it completed successfully and it moves on to plan/apply regardless of success. Here's the pre-workflow hook:
Copy code
pre_workflow_hooks:
    - run: python3 deploy.py 2>&1 | tee /opt/atlantis/packer.log
      description: Run packer deployment script before running terraform/terragrunt
      shell: bash
      shellArgs: -cv
      output: show
      commands: plan
The python script underneath is executing packer with
subprocess.run
and catching the output. It's wrapped in a try/except block, and if it catches a
CalledProcessError
I exit with a status code of 1. My understanding is this should cause the check for the step in GitHub to fail, but it still passes. Any ideas how I might fail the check when the script catches an error?
p
it should exit , you can try with a run command that just says exit 1 and should exit
it it does then maybe your program is not exiting correctly
s
j
@Simon Heather I think that's what I am missing, thank you