Demonstrates how to use the buildkite current job API to interact with the current job in languages other than bash.
Ensure that you've built the golang portion of the plugin, and placed it in the go/bin
directory:
mkdir -p $(go env GOPATH)/bin
go build -o $(go env GOPATH)/bin/job-api-test
This plugin is a no-op, but it demonstrates how to use the job API to add and remove environment variables from the current job. The plugin requires the built binary to be accessible to the agent, so this plugin isn't suitable for use in production environments.
Add the following to your pipeline.yml
:
steps:
- command: ls # or anything, really
plugins:
- test-job-api#main:
It will add two environment variables to the job during the environment
phase, OCEAN
and MOUNTAIN
. It will then remove the OCEAN
environment variable during the post-command
phase.
n/a
- Fork the repo
- Make the changes
- Run the tests
- Commit and push your changes
- Send a pull request