Code Monkey home page Code Monkey logo

metahook-buildkite-plugin's Introduction

Metahook Buildkite Plugin

A Buildkite plugin that allows running additional commands as buildkite hooks on a per-step basis.

Example

common: &common
  plugins:
  - improbable-eng/metahook:
      post-checkout: scripts/setup.sh
      pre-exit: |
        scripts/cleanup.sh
        echo "Step finished!"
        scripts/notify.sh

steps:
  - label: "Build"
    command: "scripts/build.sh"
    <<: *common

  - label: "Test"
    command: "scripts/test.sh"
    <<: *common

Metahooks execute via a bash script, searching your PATH for bash.

Metahooks execute in Bash Strict Mode.

Bash Strict Mode is provided by

  • set -o errexit - halt on error
  • set -o nounset - halt if variable is unset
  • set -o pipefail - halt if a command inside a pipe fails

You can override those choices by setting different values (e.g. set +o nounset) within your metahook.

Contributing

See contributing

metahook-buildkite-plugin's People

Contributors

ca-johnson avatar petemounce avatar super-filip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

metahook-buildkite-plugin's Issues

github-com-improbable-eng-metahook-buildkite-plugin-v0-4-1/hooks/run-hook.sh: line 17: !var_name: unbound variable

Running plugin metahook pre-command hook
# A hook runner was written to "C:\users\buildkite-agent\tmp\d6018259-8f4c-4680-a375-53215e54e7cd\buildkite-agent-bootstrap-hook-runner-106667881" with the following:
> C:\users\buildkite-agent\tmp\d6018259-8f4c-4680-a375-53215e54e7cd\buildkite-agent-bootstrap-hook-runner-106667881
# Attempting to run C:\users\buildkite-agent\tmp\d6018259-8f4c-4680-a375-53215e54e7cd\buildkite-agent-bootstrap-hook-runner-106667881 with Bash for Windows
c:/users/buildkite-agent/AppData/Local/buildkite-agent/plugins/github-com-improbable-eng-metahook-buildkite-plugin-v0-4-1/hooks/run-hook.sh: line 17: !var_name: unbound variable

It appears as though if you do not define a pre-command hook, it tries to execute it anyways and fails.

example of my plugin declaration:

  annotate-errors-plugin: &annotate-errors-plugin
    # https://github.com/improbable-eng/metahook-buildkite-plugin
    improbable-eng/metahook#v0.4.1:
      pre-exit: python "GameOne/.buildkite/metahooks/annotate_errors.py"

https://buildkite.com/improbable/midwinter-code/builds/674#d6018259-8f4c-4680-a375-53215e54e7cd/267-271

example of error no longer occurring if plugin is defined as:

  annotate-errors-plugin: &annotate-errors-plugin
    # https://github.com/improbable-eng/metahook-buildkite-plugin
    improbable-eng/metahook#v0.4.1:
      pre-command: echo "test"
      pre-exit: python "GameOne/.buildkite/metahooks/annotate_errors.py"

https://buildkite.com/improbable/midwinter-code/builds/680#b4e799c4-2a07-4f59-aa87-f8e834ef74ff

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.