A Buildkite plugin for something awesome
- Update plugin name: Change
YOUR_PLUGIN_NAME
inlib/plugin.bash
- Customize configuration: Modify
plugin.yml
for your options - Add your logic: Implement features in
hooks/command
- Use modules: For complex plugins, add modules in
lib/modules/
- Test thoroughly: Add tests in
tests/
directory
hooks/command
: Main execution logiclib/shared.bash
: Common utilities and logginglib/plugin.bash
: Configuration reading helperslib/modules/
: Optional feature modules for complex pluginshooks/environment
: Optional early setup (for complex plugins only)
See DEVELOPMENT.md for detailed development guidelines.
These are all the options available to configure this plugin's behaviour.
A great description of what this is supposed to do.
Describe how the plugin behaviour changes if this option is not specified, allowed values and its default.
An array of numeric values for processing. Each element must be a number.
Enable or disable a specific feature. Defaults to false
.
Configuration object with key-value pairs.
The hostname or IP address to connect to.
The port number to use for the connection. Defaults to 1234
.
Whether to use SSL/TLS for the connection. Defaults to true
.
Timeout value in seconds. Must be between 1 and 60 seconds.
Minimal configuration with just the required option:
steps:
- label: "π¨ Basic plugin usage"
command: "echo processing"
plugins:
- template#v1.0.0:
mandatory: "required-value"
Adding optional configuration:
steps:
- label: "π¨ Plugin with options"
command: "echo processing with options"
plugins:
- template#v1.0.0:
mandatory: "required-value"
optional: "custom-value"
timeout: 45
Handling arrays of values:
steps:
- label: "π¨ Array processing"
command: "echo processing numbers"
plugins:
- template#v1.0.0:
mandatory: "required-value"
numbers: [1, 2, 3, 5, 8]
Using boolean flags to control behavior:
steps:
- label: "π¨ Feature enabled"
command: "echo enhanced processing"
plugins:
- template#v1.0.0:
mandatory: "required-value"
enabled: true
Using nested configuration objects:
steps:
- label: "π¨ Complex config"
command: "echo connecting to service"
plugins:
- template#v1.0.0:
mandatory: "required-value"
config:
host: "api.example.com"
port: 8080
ssl: false
Secure handling of secrets using environment variables:
steps:
- label: "π¨ Using secrets"
command: "echo authenticated processing"
plugins:
- secrets#v1.0.0:
MY_SECRET_TOKEN: secret_key_in_buildkite_secrets
- template#v1.0.0:
mandatory: "required-value"
optional: "MY_SECRET_TOKEN" # Pass env var name instead of secret value
In the plugin code, use ${!config_value}
to get the secret value from the environment variable name.
Enabling verbose logging for troubleshooting:
steps:
- label: "π¨ Debug mode"
command: "echo detailed processing"
plugins:
- template#v1.0.0:
mandatory: "required-value"
env:
BUILDKITE_PLUGIN_DEBUG: "true"
Elastic Stack | Agent Stack K8s | Hosted (Mac) | Hosted (Linux) | Notes |
---|---|---|---|---|
? | ? | ? | ? | n/a |
- β Fully supported (all combinations of attributes have been tested to pass)
β οΈ Partially supported (some combinations cause errors/issues)- β Not supported
- Follow the patterns established in this template
- Add tests for new functionality
- Update documentation for any new options
- Ensure shellcheck passes (fix issues, don't just disable checks - disabling should be done very seldomly and with team documentation/agreement)
- Test with the plugin tester
Run all tests:
docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-tester
Validate plugin structure:
# Replace 'your-plugin-name' with your actual plugin name
docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-linter --id your-plugin-name --path /plugin
Run shellcheck:
shellcheck hooks/* tests/* lib/*.bash lib/modules/* lib/providers/*
The package is available as open source under the terms of the MIT License.