agent icon indicating copy to clipboard operation
agent copied to clipboard

Add BUILDKITE_ORGANIZATION_ID to the list of supported environment variables

Open staticfloat opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. It would be useful to have the organization ID (e.g. as used in calculating artifact upload URLs) exposed as an environment variable to hooks (e.g. for writing plugins that want to manually calculate artifact URLs). At the moment, it is nontrivial to determine the organization ID from within, for instance, a plugin hook.

Describe the solution you'd like I would like a BUILDKITE_ORGANIZATION_ID environment variable exposed by the buildkite agent, similarly to BUILDKITE_PIPELINE_ID, BUILDKITE_JOB_ID, etc...

Describe alternatives you've considered I have considered requiring the user to provide the organization ID as a parameter to my plugin, or even a token to allow the plugin hook to look up the organization ID from the web API, but neither are particularly useful.

staticfloat avatar Oct 20 '22 18:10 staticfloat

hi there @staticfloat! we don't currently expose the org ID to the agent, but the $BUILDKITE_ORGANIZATION_SLUG should be available to each job. This slug is unique per org, and stands in for the org id in user-facing situations.

If the slug doesn't fulfill your needs, would you be able to tell us a little bit more about your use case?

moskyb avatar Nov 01 '22 01:11 moskyb