Skip to content
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- id: check-useless-excludes
priority: 0
- repo: https://github.com/ansible/actions
rev: v1.1.0
rev: v1.1.1
hooks:
- id: toml
priority: 0
Expand Down
30 changes: 25 additions & 5 deletions tools/ee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,32 @@ if [ "--publish" == "${1:-}" ]; then
echo "Unable to find GITHUB_SHA variable."
exit 1
fi
${ADT_CONTAINER_ENGINE} pull -q "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"
${ADT_CONTAINER_ENGINE} pull -q "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64"

for TAG in ghcr.io/ansible/community-ansible-dev-tools:${2:-} ghcr.io/ansible/community-ansible-dev-tools:${3:-}; do
${ADT_CONTAINER_ENGINE} manifest create "$TAG" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"
${ADT_CONTAINER_ENGINE} manifest annotate --arch arm64 "$TAG" "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"
FINAL_REPO="ghcr.io/ansible/community-ansible-dev-tools"
TMP_REPO="ghcr.io/ansible/community-ansible-dev-tools-tmp"

${ADT_CONTAINER_ENGINE} pull -q "${TMP_REPO}:${GITHUB_SHA:-}-arm64"
${ADT_CONTAINER_ENGINE} pull -q "${TMP_REPO}:${GITHUB_SHA:-}-amd64"

# Re-tag and push arch-specific images to the final repository to avoid
# cross-repository blob mounting issues when creating the manifest.
# GHCR cannot mount blobs across different repositories, so we must push
# the images to the target repository before creating the manifest.
for IMG_ARCH in amd64 arm64; do
${ADT_CONTAINER_ENGINE} tag "${TMP_REPO}:${GITHUB_SHA:-}-${IMG_ARCH}" "${FINAL_REPO}:${GITHUB_SHA:-}-${IMG_ARCH}"
if [ "${CI:-}" == "true" ]; then
${ADT_CONTAINER_ENGINE} push "${FINAL_REPO}:${GITHUB_SHA:-}-${IMG_ARCH}"
fi
done

TAGS=("${FINAL_REPO}:${2:-}")
if [ -n "${3:-}" ]; then
TAGS+=("${FINAL_REPO}:${3}")
fi

for TAG in "${TAGS[@]}"; do
${ADT_CONTAINER_ENGINE} manifest create "$TAG" --amend "${FINAL_REPO}:${GITHUB_SHA:-}-amd64" --amend "${FINAL_REPO}:${GITHUB_SHA:-}-arm64"
${ADT_CONTAINER_ENGINE} manifest annotate --arch arm64 "$TAG" "${FINAL_REPO}:${GITHUB_SHA:-}-arm64"

if [ "${CI:-}" == "true" ]; then
${ADT_CONTAINER_ENGINE} manifest push "$TAG"
Expand Down
Loading