Closed rsimiciuc closed 5 years ago
Are you using docker or something?
https://buildkite.com/docs/agent/v3/hooks - look at hooks, especially pre-command
hook
BTW there's slack - https://chat.buildkite.community/
Sorry, that’s not possible in pipeline.yml — you can use a repository hook to export it with that same conditional logic though! I’ll close this, as it’s on the feedback repo, but feel free to keep replying if you need. Alternatively, the Slack @adis-io mentioned, or support@buildkite.com 😊
Is it possible to set environment variables based on the branch being built?
I have to set different credentials and url variable if the branch is master
For example it will be useful if code blocks are accepted in the environment block like:
environment variables:
if [[ "$BUILDKITE_BRANCH" = "master" ]]; then URL="productionurl.com" else URL="qa.site.com" fi