1. Resources
  2. /
  3. Plugins
  4. /
  5. post-buildkite-plugin

Post buildkite plugin

A Buildkite plugin for running pipeline serial steps conditionally when a step has succeed or failed

The post section defines one or more additional steps that are run upon the completion of a command.

post can support any of of the following post-condition blocks: failure, success. These condition blocks allow the execution of serial steps inside each condition depending on the completion status of the step.

Example

The following pipeline will execute annotate.sh, wait for completion, and then cleanup.sh only when the command fails

steps:
  - command: test.sh
    plugins:
      - telefonica/post#0.1.1:
          post:
            - when: failure
              # steps is a string, note the `|`
              steps: |
                - command: email.sh
                - wait
                - command: clenaup.sh
            - when: success
              # steps is a string, note the `|`
              steps: |
                - command: slack.sh

How it works

The plugin evaluates the command exit code, (via post-command hook) and starts adding one step after another dynamically using buildkite-agent pipeline upload

When adding a pipeline dynamically, it’s executed by buildkite directly after the step that added it. But when a wait is found after a failure in this situation, the execution will be aborted. The plugin transform the pipeline and uses this trick to add steps one after another, making possible to have a serial pipeline (with wait) after failures.

Current limitations

  • Only wait, command and plugins are available as steps in the post section
  • Parallel steps in the steps sections are not allowed when using wait

This does not work

steps:
  - command: test.sh
    plugins:
      - telefonica/post#0.1.1:
          post:
            - when: failure
              steps: |
                - command: annotate.sh
                - command: email.sh
                - wait
                - command: clenaup.sh

But are allowed when not using wait

This work

steps:
  - command: test.sh
    plugins:
      - telefonica/post#0.1.1:
          post:
            - when: failure
              steps: |
                - command: annotate.sh
                - command: email.sh
                - command: clenaup.sh

License

Copyright 2018 Telefónica

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Pipeline templates
  3. Public pipelines
  4. Test Engine
  5. Package Registries
  6. Mobile Delivery Cloud
  7. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Webinars
  5. Plugins
  6. Case studies
  7. Events
  8. Migration Services
  9. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025