Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion packer/linux/conf/buildkite-agent/hooks/environment
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ fi
if [[ "${BUILDKITE_ECR_POLICY:-}" != "none" && "${ECR_PLUGIN_ENABLED:-}" == "1" ]]; then
export BUILDKITE_PLUGIN_ECR_LOGIN=1
export BUILDKITE_PLUGIN_ECR_RETRIES=3
export BUILDKITE_PLUGIN_ECR_CREDENTIAL_HELPER=true

# Allow pipeline-level override, otherwise use CloudFormation parameter
set_unless_present "BUILDKITE_PLUGIN_ECR_CREDENTIAL_HELPER" "${ECR_CREDENTIAL_HELPER_ENABLED:-true}"

# map AWS_ECR_LOGIN_REGISTRY_IDS into the plugin list format
if [[ -n "${AWS_ECR_LOGIN_REGISTRY_IDS:-}" ]]; then
Expand Down
4 changes: 3 additions & 1 deletion packer/windows/conf/buildkite-agent/hooks/environment
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ fi
if [[ "${BUILDKITE_ECR_POLICY:-}" != "none" && "${ECR_PLUGIN_ENABLED:-}" == "1" ]]; then
export BUILDKITE_PLUGIN_ECR_LOGIN=1
export BUILDKITE_PLUGIN_ECR_RETRIES=3
export BUILDKITE_PLUGIN_ECR_CREDENTIAL_HELPER=true

# Allow pipeline-level override, otherwise use CloudFormation parameter
set_unless_present "BUILDKITE_PLUGIN_ECR_CREDENTIAL_HELPER" "${ECR_CREDENTIAL_HELPER_ENABLED:-true}"

# map AWS_ECR_LOGIN_REGISTRY_IDS into the plugin list format
if [[ -n "${AWS_ECR_LOGIN_REGISTRY_IDS:-}" ]]; then
Expand Down
11 changes: 11 additions & 0 deletions templates/aws-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Metadata:
Parameters:
- EnableSecretsPlugin
- EnableECRPlugin
- EnableECRCredentialHelper
- EnableDockerLoginPlugin

Parameters:
Expand Down Expand Up @@ -848,6 +849,14 @@ Parameters:
- "false"
Default: "true"

EnableECRCredentialHelper:
Type: String
Description: Enable Amazon ECR Credential Helper in ECR plugin for Docker authentication.
AllowedValues:
- "true"
- "false"
Default: "true"

EnableDockerLoginPlugin:
Type: String
Description: Enables docker-login plugin for all pipelines.
Expand Down Expand Up @@ -1869,6 +1878,7 @@ Resources:
$Env:AWS_DEFAULT_REGION="${AWS::Region}"
$Env:SECRETS_PLUGIN_ENABLED="${EnableSecretsPlugin}"
$Env:ECR_PLUGIN_ENABLED="${EnableECRPlugin}"
$Env:ECR_CREDENTIAL_HELPER_ENABLED="${EnableECRCredentialHelper}"
$Env:DOCKER_LOGIN_PLUGIN_ENABLED="${EnableDockerLoginPlugin}"
$Env:AWS_REGION="${AWS::Region}"
$Env:ENABLE_EC2_LOG_RETENTION_POLICY="${EnableEC2LogRetentionPolicy}"
Expand Down Expand Up @@ -1962,6 +1972,7 @@ Resources:
AWS_DEFAULT_REGION="${AWS::Region}" \
SECRETS_PLUGIN_ENABLED="${EnableSecretsPlugin}" \
ECR_PLUGIN_ENABLED="${EnableECRPlugin}" \
ECR_CREDENTIAL_HELPER_ENABLED="${EnableECRCredentialHelper}" \
DOCKER_LOGIN_PLUGIN_ENABLED="${EnableDockerLoginPlugin}" \
DOCKER_EXPERIMENTAL="${EnableDockerExperimental}" \
DOCKER_USERNS_REMAP=${EnableDockerUserNamespaceRemap} \
Expand Down