Skip to content

Instantly share code, notes, and snippets.

@lox
Last active June 16, 2017 03:09
Show Gist options
  • Save lox/13b30deb7cdc2b033ef77fe64d6f3469 to your computer and use it in GitHub Desktop.
Save lox/13b30deb7cdc2b033ef77fe64d6f3469 to your computer and use it in GitHub Desktop.
Create a wrapper for buildkite-agent to source config from a custom credential management system
#!/bin/bash
set -e -a
source /etc/my_secrets
exec /usr/bin/buildkite-agent "$@
# This is a systemd drop-in that should be put in /etc/systemd/system/buildkite-agent.d/envfile.conf
[Service]
ExecStart=
ExecStart=/usr/bin/buildkite-agent-wrapper start
# As of agent v2.6.4 you can write the below to /etc/default/buildkite-agent 🎉
export BUILDKITE_AGENT=/usr/bin/buildkite-agent-wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment