Code build continues after build fails

前端 未结 5 1564
天涯浪人
天涯浪人 2020-12-23 17:17

I\'m building a CI/CD pipeline using git, codebuild and elastic beanstalk.

During codebuild execution when build fails due to syntax error of a test case, I see cod

5条回答
  •  孤城傲影
    2020-12-23 17:45

    I just wanted to point out that if you want the whole execution to stop when a command fails, you may specify the -e option:

    • When running a bash file

        - /bin/bash -e ./commands.sh
      
    • Or when running a set of commands/bash file

      #!/bin/bash
      
      set -e
      
      # ... commands
      

提交回复
热议问题