Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always use a fresh docker config for each step #756

Merged
merged 7 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packer/linux/conf/buildkite-agent/hooks/environment
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -eu -o pipefail
# shellcheck source=/dev/null
source ~/cfn-env

# a clean docker config for each job, for improved isolation
BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY=$(mktemp -d)
export BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY
export DOCKER_CONFIG="$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY"

echo "~~~ :llama: Setting up elastic stack environment ($BUILDKITE_STACK_VERSION)"
cat ~/cfn-env

Expand Down
5 changes: 5 additions & 0 deletions packer/linux/conf/buildkite-agent/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -eu -o pipefail

# clean up our temporary docker config
if [[ -n "${BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY:-}" ]]; then
rmdir "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY"
fi
yob marked this conversation as resolved.
Show resolved Hide resolved

if [[ -n "${BUILDKITE_SECRETS_BUCKET:-}" && "${SECRETS_PLUGIN_ENABLED:-}" == "1" ]] ; then
export BUILDKITE_PLUGIN_S3_SECRETS_BUCKET="$BUILDKITE_SECRETS_BUCKET"

Expand Down
5 changes: 5 additions & 0 deletions packer/windows/conf/buildkite-agent/hooks/environment
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -eu -o pipefail
# shellcheck source=/dev/null
source ~/cfn-env

# a clean docker config for each job, for improved isolation
BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY=$(mktemp -d)
export BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY
export DOCKER_CONFIG="$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY"

echo "~~~ :llama: Setting up elastic stack environment ($BUILDKITE_STACK_VERSION)"
cat ~/cfn-env

Expand Down
5 changes: 5 additions & 0 deletions packer/windows/conf/buildkite-agent/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -eu -o pipefail

# clean up our temporary docker config
if [[ -n "${BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY:-}" ]]; then
rmdir "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY"
fi

if [[ -n "${BUILDKITE_SECRETS_BUCKET:-}" && "${SECRETS_PLUGIN_ENABLED:-}" == "1" ]] ; then
export BUILDKITE_PLUGIN_S3_SECRETS_BUCKET="$BUILDKITE_SECRETS_BUCKET"

Expand Down