Skip to content

Commit 6086a83

Browse files
authored
Merge pull request #1565 from buildkite/SUP-4593-enable-ecr-credential-helper
Enable ECR Credential Helper, update plugins, PATH fix
2 parents 9618cb4 + 3966229 commit 6086a83

File tree

7 files changed

+14
-4
lines changed

7 files changed

+14
-4
lines changed

packer/linux/conf/buildkite-agent/hooks/environment

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ fi
109109
if [[ "${BUILDKITE_ECR_POLICY:-}" != "none" && "${ECR_PLUGIN_ENABLED:-}" == "1" ]]; then
110110
export BUILDKITE_PLUGIN_ECR_LOGIN=1
111111
export BUILDKITE_PLUGIN_ECR_RETRIES=3
112+
export BUILDKITE_PLUGIN_ECR_CREDENTIAL_HELPER=true
112113

113114
# map AWS_ECR_LOGIN_REGISTRY_IDS into the plugin list format
114115
if [[ -n "${AWS_ECR_LOGIN_REGISTRY_IDS:-}" ]]; then

packer/linux/scripts/install-buildkite-utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo "Installing fix-buildkite-agent-builds-permissions..."
1515
sudo chmod +x "/tmp/build/fix-perms-linux-${ARCH}"
1616
sudo mv "/tmp/build/fix-perms-linux-${ARCH}" /usr/bin/fix-buildkite-agent-builds-permissions
1717

18-
S3_SECRETS_HELPER_VERSION=2.2.0
18+
S3_SECRETS_HELPER_VERSION=2.5.0
1919
echo "Downloading s3-secrets-helper ${S3_SECRETS_HELPER_VERSION}..."
2020
sudo curl -Lsf -o /usr/local/bin/s3secrets-helper \
2121
"https://github.com/buildkite/elastic-ci-stack-s3-secrets-hooks/releases/download/v${S3_SECRETS_HELPER_VERSION}/s3secrets-helper-linux-${ARCH}"

packer/windows/conf/buildkite-agent/hooks/environment

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ fi
5555
if [[ "${BUILDKITE_ECR_POLICY:-}" != "none" && "${ECR_PLUGIN_ENABLED:-}" == "1" ]]; then
5656
export BUILDKITE_PLUGIN_ECR_LOGIN=1
5757
export BUILDKITE_PLUGIN_ECR_RETRIES=3
58+
export BUILDKITE_PLUGIN_ECR_CREDENTIAL_HELPER=true
5859

5960
# map AWS_ECR_LOGIN_REGISTRY_IDS into the plugin list format
6061
if [[ -n "${AWS_ECR_LOGIN_REGISTRY_IDS:-}" ]]; then

packer/windows/scripts/install-docker.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ $docker_plugins_dir = "${env:ProgramFiles}\Docker"
1818
New-Item -ItemType Directory -Force -Path $docker_plugins_dir | Out-Null
1919
Invoke-WebRequest -Uri $ecr_cred_helper_url -OutFile "$docker_plugins_dir\docker-credential-ecr-login.exe"
2020
Write-Output "Amazon ECR credential helper v$ecr_cred_helper_version installed to $docker_plugins_dir"
21+
22+
Write-Output "Adding Docker plugins directory to system PATH..."
23+
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
24+
if ($oldpath -notlike "*$docker_plugins_dir*") {
25+
$newpath = "$docker_plugins_dir;$oldpath"
26+
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newpath
27+
Write-Output "Added $docker_plugins_dir to system PATH"
28+
}

packer/windows/scripts/install-s3secrets-helper.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Stop script execution when a non-terminating error occurs
22
$ErrorActionPreference = "Stop"
33

4-
$S3_SECRETS_HELPER_VERSION = "2.2.0"
4+
$S3_SECRETS_HELPER_VERSION = "2.5.0"
55

66
Write-Output "Downloading s3-secrets-helper v${S3_SECRETS_HELPER_VERSION}..."
77
Invoke-WebRequest -OutFile C:\buildkite-agent\bin\s3secrets-helper.exe -Uri "https://github.com/buildkite/elastic-ci-stack-s3-secrets-hooks/releases/download/v${S3_SECRETS_HELPER_VERSION}/s3secrets-helper-windows-amd64"

0 commit comments

Comments
 (0)