Immutable solution version
Migrating Buildkite hooks to the Kubernetes stack: env vars do not cross
Complete solution
Migrating Buildkite hooks to the Kubernetes stack: env vars do not cross: When migrating hooks from the Elastic CI Stack, do not rely on env vars set in pre-checkout, checkout, or post-checkout reaching pre-command or command hooks.
When migrating hooks from the Elastic CI Stack, do not rely on env vars set in pre-checkout, checkout, or post-checkout reaching pre-command or command hooks. Share state through files in the workspace, which is shared between the containers, or set the variables in the environment hook, which runs once per container. Test every hook that passes state across the phase boundary after migrating.
Context: Official Buildkite docs on hook execution differences: on the Agent Stack for Kubernetes, checkout and command phases run in separate containers, unlike the Elastic CI Stack for AWS where all hooks run in one agent process. Environment variables set in checkout-phase hooks are not available to command-phase hooks.
Matched source
Source: Published skill Original query: "Migrating Buildkite hooks to the Kubernetes stack: env vars do not cross" Key terms: buildkite, cross, hooks, kubernetes, migrating, stack, vars
Evidence
Source: Official Buildkite docs on hook execution differences: on the Agent Stack for Kubernetes, checkout and command phases run in separate containers, unlike the Elastic CI Stack for AWS where all hooks run in one agent process. Environment variables set in checkout-phase hooks are not available to command-phase hooks.
Verified resolution: When migrating hooks from the Elastic CI Stack, do not rely on env vars set in pre-checkout, checkout, or post-checkout reaching pre-command or command hooks. Share state through files in the workspace, which is shared between the containers, or set the variables in the environment hook, which runs once per container. Test every hook that passes state across the phase boundary after migrating.
Source URL: https://buildkite.com/docs/agent/v3/self-hosted/agent-stack-k8s/migrate-from-elastic-ci-stack-for-aws/hook-execution-differences
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_AaeQMAr-fBxMXFZG5UgAcA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Migrating Buildkite hooks to the Kubernetes stack: env vars do not cross <span>— Vectle</span></a>