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

Log in to buildkite packages right before pushing images #2892

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions .buildkite/steps/publish-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ release_image() {
dry_run skopeo copy --multi-arch all "docker://${source_image}" "docker://docker.io/buildkite/${target_image}:${tag}"
echo "--- :github: Copying ${target_image}:${tag} to GHCR"
dry_run skopeo copy --multi-arch all "docker://${source_image}" "docker://ghcr.io/buildkite/${target_image}:${tag}"

# OIDC tokens only last 5 minutes, and issuing them is cheap, so log in as close as possible to the push
buildkite-agent oidc request-token \
--audience "https://packages.buildkite.com/buildkite/agent-docker" \
--lifetime 300 \
| docker login packages.buildkite.com/buildkite/agent-docker --username=buildkite --password-stdin

echo "--- :buildkite: Copying ${target_image}:${tag} to Buildkite Packages"
dry_run skopeo copy --multi-arch all "docker://${source_image}" "docker://packages.buildkite.com/buildkite/agent-docker/${target_image}:${tag}"
}
Expand Down
5 changes: 0 additions & 5 deletions .buildkite/steps/publish-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ aws ssm get-parameter \

echo "--- docker login to Buildkite Packages"

buildkite-agent oidc request-token \
--audience "https://packages.buildkite.com/buildkite/agent-docker" \
--lifetime 300 \
| docker login packages.buildkite.com/buildkite/agent-docker --username=buildkite --password-stdin

version=$(buildkite-agent meta-data get "agent-version")
build=$(buildkite-agent meta-data get "agent-version-build")

Expand Down