Skip to content

Instantly share code, notes, and snippets.

@aelindeman
Last active January 17, 2026 21:03
Show Gist options
  • Select an option

  • Save aelindeman/0b93fb8a92dbc9d65a5841031f9b21c5 to your computer and use it in GitHub Desktop.

Select an option

Save aelindeman/0b93fb8a92dbc9d65a5841031f9b21c5 to your computer and use it in GitHub Desktop.
Multi-arch oras artifact pipeline
#!/usr/bin/env bash
set -eu -o pipefail
repo="localhost:5000/path/to/thing"
tags="${BUILDKITE_COMMIT:0:7},${BUILDKITE_BRANCH//[^A-Za-z0-9-]/-}"
[[ "$BUILDKITE_BRANCH" == "$BUILDKITE_PIPELINE_DEFAULT_BRANCH" ]] && tags+=",$(cat .release-version),latest"
digests=()
buildkite-agent artifact download "thing-*.tar.gz" .
for artifact in thing-*.tar.gz; do
platform="${artifact#thing-}"
platform="${platform%.tar.gz}"
platform="${platform/-//}"
digests+=("$(oras push --artifact-platform="$platform" "$repo" "$artifact" --format=go-template="{{.digest}}")")
done
oras manifest index create "$repo:$tags" "${digests[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment