-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from Scrumplex/aarch64-support-manifest
Generate multi-arch image manifests
- Loading branch information
Showing
5 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# CI specific build script. | ||
# | ||
set -euo pipefail | ||
|
||
channel=${NIXPKGS_CHANNEL:-nixos-unstable} | ||
registry=${CI_REGISTRY:-docker.io} | ||
registry_auth=${CI_REGISTRY_AUTH:-} | ||
image_prefix=${CI_PROJECT_PATH:-nixpkgs} | ||
|
||
if [[ $channel == nixos-unstable ]]; then | ||
image_tag=latest | ||
else | ||
image_tag=$channel | ||
fi | ||
|
||
export NIX_PATH=channel:$channel | ||
|
||
banner() { | ||
echo "========================================================" | ||
echo " $*" | ||
echo "========================================================" | ||
} | ||
|
||
cd "$(dirname "$0")" | ||
|
||
if [[ $(git rev-parse --abbrev-ref HEAD) != master ]]; then | ||
banner "Skipping push on non-master branch" | ||
exit | ||
fi | ||
|
||
if [[ -n "${registry_auth}" ]]; then | ||
banner "docker login" | ||
./docker-login "$registry_auth" "$registry" | ||
fi | ||
|
||
banner "generate manifests" | ||
./generate-manifests "$registry" "$image_prefix" "$image_tag" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Usage: ./push-all <registry> <image-prefix> <image-tag> | ||
set -euo pipefail | ||
|
||
registry=${1:-docker.io} | ||
image_prefix=${2:-nixpkgs} | ||
image_tag=${3:-latest} | ||
system_name=${NIX_SYSTEM_NAME:-x86_64-linux} | ||
|
||
releases_json=$(nix-instantiate --strict --argstr system "$system_name" --eval --json) | ||
|
||
echo "=== Generating manifests for $registry" | ||
|
||
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do | ||
repository=$registry/$image_prefix/$attr | ||
target_image=${repository}:${image_tag} | ||
echo "--- attr=$attr target=$target_image" | ||
podman manifest create "$target_image" | ||
podman manifest add "$target_image" "docker://$repository:${image_tag}-x86_64-linux" | ||
podman manifest add "$target_image" "docker://$repository:${image_tag}-aarch64-linux" | ||
podman manifest push --all "$target_image" "docker://$target_image" | ||
done | ||
|
||
echo OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters