A wait step waits for all previous steps to have successfully completed before allowing following jobs to continue.
A basic wait step can be defined in your pipeline settings, or in your pipeline.yml file. It can be placed between steps to ensure that previous steps are successful before continuing to run the rest.
- command: "command.sh" - wait - command: "echo The command passed"
Continuing on failure
You can also configure the wait step to continue even if the previous steps failed.
If the previous steps failed, the build will be marked as failed only after the steps after the
wait have completed. This is useful for processing results from previous steps, such as test coverage, or summarizing test failures.
- command: "command.sh" - wait: ~ continue_on_failure: true - command: "echo This runs regardless of the success or failure" - wait - command: "echo The command passed"
In this example, if
command.sh succeeds, both of the following command steps will be run. If
command.sh fails, only the first will be run, and the build will then be marked as failed.