2026-02-08 05:00:48 -09:00
|
|
|
export repo_organization := env("GITHUB_REPOSITORY_OWNER", "ublue-os")
|
|
|
|
|
export base_image_org := env("BASE_IMAGE_ORG", "quay.io/fedora-ostree-desktops")
|
|
|
|
|
export base_image_name := env("BASE_IMAGE_NAME", "kinoite")
|
|
|
|
|
export common_image := env("COMMON_IMAGE", "ghcr.io/get-aurora-dev/common:latest")
|
|
|
|
|
export brew_image := env("BREW_IMAGE", "ghcr.io/ublue-os/brew:latest")
|
2026-05-08 07:41:58 -08:00
|
|
|
stable_version := "44"
|
2026-04-03 11:34:39 -08:00
|
|
|
latest_version := "44"
|
2026-03-12 01:39:30 -08:00
|
|
|
beta_version := "44"
|
2024-11-04 19:13:24 -09:00
|
|
|
images := '(
|
|
|
|
|
[aurora]=aurora
|
|
|
|
|
[aurora-dx]=aurora-dx
|
|
|
|
|
)'
|
|
|
|
|
flavors := '(
|
|
|
|
|
[main]=main
|
2025-01-02 14:21:43 -09:00
|
|
|
[nvidia-open]=nvidia-open
|
2024-11-04 19:13:24 -09:00
|
|
|
)'
|
|
|
|
|
tags := '(
|
|
|
|
|
[stable]=stable
|
|
|
|
|
[latest]=latest
|
|
|
|
|
[beta]=beta
|
|
|
|
|
)'
|
2025-01-21 19:57:03 -09:00
|
|
|
export SUDO_DISPLAY := if `if [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; then echo true; fi` == "true" { "true" } else { "false" }
|
2026-03-06 10:32:32 -09:00
|
|
|
export SUDOIF := if `id -u` == "0" { "" } else { "sudo" }
|
2025-01-23 05:06:40 -09:00
|
|
|
export PODMAN := if path_exists("/usr/bin/podman") == "true" { env("PODMAN", "/usr/bin/podman") } else if path_exists("/usr/bin/docker") == "true" { env("PODMAN", "docker") } else { env("PODMAN", "exit 1 ; ") }
|
2025-01-21 19:57:03 -09:00
|
|
|
export PULL_POLICY := if PODMAN =~ "docker" { "missing" } else { "newer" }
|
2025-05-18 23:39:33 -08:00
|
|
|
just := just_executable()
|
2024-05-07 15:51:42 -08:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
[private]
|
|
|
|
|
default:
|
2025-05-18 23:39:33 -08:00
|
|
|
@{{ just }} --list
|
2024-05-10 19:34:56 -08:00
|
|
|
|
|
|
|
|
# Check Just Syntax
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Just')]
|
2024-11-04 19:13:24 -09:00
|
|
|
check:
|
2024-05-10 19:34:56 -08:00
|
|
|
#!/usr/bin/bash
|
2024-11-04 19:13:24 -09:00
|
|
|
find . -type f -name "*.just" | while read -r file; do
|
2024-05-10 19:34:56 -08:00
|
|
|
echo "Checking syntax: $file"
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} --unstable --fmt --check -f $file
|
2024-05-10 19:34:56 -08:00
|
|
|
done
|
2024-11-04 19:13:24 -09:00
|
|
|
echo "Checking syntax: Justfile"
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} --unstable --fmt --check -f Justfile
|
2024-05-10 19:34:56 -08:00
|
|
|
|
|
|
|
|
# Fix Just Syntax
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Just')]
|
2024-11-04 19:13:24 -09:00
|
|
|
fix:
|
2024-05-10 19:34:56 -08:00
|
|
|
#!/usr/bin/bash
|
2024-11-04 19:13:24 -09:00
|
|
|
find . -type f -name "*.just" | while read -r file; do
|
2024-05-10 19:34:56 -08:00
|
|
|
echo "Checking syntax: $file"
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} --unstable --fmt -f $file
|
2024-05-10 19:34:56 -08:00
|
|
|
done
|
2024-11-04 19:13:24 -09:00
|
|
|
echo "Checking syntax: Justfile"
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} --unstable --fmt -f Justfile || { exit 1; }
|
2024-11-04 19:13:24 -09:00
|
|
|
|
|
|
|
|
# Clean Repo
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Utility')]
|
2024-11-04 19:13:24 -09:00
|
|
|
clean:
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eoux pipefail
|
2024-11-10 13:56:21 -09:00
|
|
|
rm -f changelog.md
|
|
|
|
|
rm -f output.env
|
2026-05-09 05:00:06 -08:00
|
|
|
rm -rf sbom_out
|
2024-11-04 19:13:24 -09:00
|
|
|
|
|
|
|
|
# Check if valid combo
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Utility')]
|
2024-11-04 19:13:24 -09:00
|
|
|
[private]
|
2025-01-02 14:21:43 -09:00
|
|
|
validate $image $tag $flavor:
|
2024-11-04 19:13:24 -09:00
|
|
|
#!/usr/bin/bash
|
2024-11-10 13:56:21 -09:00
|
|
|
set -eou pipefail
|
2024-11-04 19:13:24 -09:00
|
|
|
declare -A images={{ images }}
|
|
|
|
|
declare -A tags={{ tags }}
|
|
|
|
|
declare -A flavors={{ flavors }}
|
2024-11-11 07:01:52 -09:00
|
|
|
|
|
|
|
|
# Handle Stable Daily
|
|
|
|
|
if [[ "${tag}" == "stable-daily" ]]; then
|
|
|
|
|
tag="stable"
|
|
|
|
|
fi
|
|
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
checkimage="${images[${image}]-}"
|
|
|
|
|
checktag="${tags[${tag}]-}"
|
|
|
|
|
checkflavor="${flavors[${flavor}]-}"
|
|
|
|
|
|
|
|
|
|
# Validity Checks
|
|
|
|
|
if [[ -z "$checkimage" ]]; then
|
|
|
|
|
echo "Invalid Image..."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
if [[ -z "$checktag" ]]; then
|
|
|
|
|
echo "Invalid tag..."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2024-11-11 07:01:52 -09:00
|
|
|
if [[ -z "$checkflavor" ]]; then
|
|
|
|
|
echo "Invalid flavor..."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2024-11-04 19:13:24 -09:00
|
|
|
|
2024-05-07 15:51:42 -08:00
|
|
|
# Build Image
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Image')]
|
2025-01-02 14:21:43 -09:00
|
|
|
build $image="aurora" $tag="latest" $flavor="main" rechunk="0" ghcr="0" pipeline="0" $kernel_pin="":
|
2024-11-04 19:13:24 -09:00
|
|
|
#!/usr/bin/bash
|
2025-01-21 19:57:03 -09:00
|
|
|
|
|
|
|
|
echo "::group:: Build Prep"
|
2024-11-04 19:13:24 -09:00
|
|
|
set -eoux pipefail
|
2024-05-07 15:51:42 -08:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# Validate
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} validate "${image}" "${tag}" "${flavor}"
|
2024-05-07 15:51:42 -08:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# Image Name
|
2025-05-18 23:39:33 -08:00
|
|
|
image_name=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
|
2024-05-07 15:51:42 -08:00
|
|
|
|
2025-11-29 05:54:30 -09:00
|
|
|
common_image_sha=$(yq -r '.images[] | select(.name == "common") | .digest' image-versions.yml)
|
2025-12-27 22:09:07 -09:00
|
|
|
brew_image_sha=$(yq -r '.images[] | select(.name == "brew") | .digest' image-versions.yml)
|
2025-11-29 05:54:30 -09:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# AKMODS Flavor and Kernel Version
|
2025-10-24 11:11:49 -08:00
|
|
|
if [[ "${tag}" =~ stable ]]; then
|
2025-02-03 22:25:39 -09:00
|
|
|
akmods_flavor="coreos-stable"
|
2024-11-04 19:13:24 -09:00
|
|
|
elif [[ "${tag}" =~ beta ]]; then
|
2025-03-26 05:33:37 -08:00
|
|
|
akmods_flavor="main"
|
2024-11-04 19:13:24 -09:00
|
|
|
else
|
|
|
|
|
akmods_flavor="main"
|
|
|
|
|
fi
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Fedora Version
|
|
|
|
|
if [[ {{ ghcr }} == "0" ]]; then
|
|
|
|
|
rm -f /tmp/manifest.json
|
|
|
|
|
fi
|
2025-05-18 23:39:33 -08:00
|
|
|
fedora_version=$({{ just }} fedora_version '{{ image }}' '{{ tag }}' '{{ flavor }}' '{{ kernel_pin }}')
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Verify Base Image with cosign
|
2026-02-08 05:00:48 -09:00
|
|
|
{{ just }} verify-container quay.io-fedora-ostree-desktops.pub ${base_image_org}/${base_image_name}:${fedora_version}
|
2026-01-24 21:24:40 -09:00
|
|
|
|
2024-11-10 13:56:21 -09:00
|
|
|
# Kernel Release/Pin
|
|
|
|
|
if [[ -z "${kernel_pin:-}" ]]; then
|
2025-02-05 09:02:54 -09:00
|
|
|
kernel_release=$(skopeo inspect --retry-times 3 docker://ghcr.io/ublue-os/akmods:"${akmods_flavor}"-"${fedora_version}" | jq -r '.Labels["ostree.linux"]')
|
2024-11-10 13:56:21 -09:00
|
|
|
else
|
|
|
|
|
kernel_release="${kernel_pin}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Verify Containers with Cosign
|
2026-01-24 21:24:40 -09:00
|
|
|
{{ just }} verify-container cosign.pub "ghcr.io/ublue-os/akmods:${akmods_flavor}-${fedora_version}-${kernel_release}"
|
2024-11-10 13:56:21 -09:00
|
|
|
if [[ "${akmods_flavor}" =~ coreos ]]; then
|
2026-01-24 21:24:40 -09:00
|
|
|
{{ just }} verify-container cosign.pub "ghcr.io/ublue-os/akmods-zfs:${akmods_flavor}-${fedora_version}-${kernel_release}"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
2025-01-02 14:21:43 -09:00
|
|
|
if [[ "${flavor}" =~ nvidia-open ]]; then
|
2026-01-24 21:24:40 -09:00
|
|
|
{{ just }} verify-container cosign.pub "ghcr.io/ublue-os/akmods-nvidia-open:${akmods_flavor}-${fedora_version}-${kernel_release}"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
2026-04-26 06:55:40 -08:00
|
|
|
cosign verify \
|
|
|
|
|
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
|
|
|
|
|
--certificate-identity-regexp="github.com/get-aurora-dev/common/.github/workflows/*" \
|
|
|
|
|
"ghcr.io/get-aurora-dev/common:latest@${common_image_sha}"
|
2025-11-29 05:54:30 -09:00
|
|
|
|
2026-01-24 21:24:40 -09:00
|
|
|
{{ just }} verify-container cosign.pub "ghcr.io/ublue-os/brew:latest@${brew_image_sha}"
|
2025-12-27 22:09:07 -09:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# Get Version
|
2024-11-12 20:55:04 -09:00
|
|
|
if [[ "${tag}" =~ stable ]]; then
|
|
|
|
|
ver="${fedora_version}.$(date +%Y%m%d)"
|
|
|
|
|
else
|
|
|
|
|
ver="${tag}-${fedora_version}.$(date +%Y%m%d)"
|
|
|
|
|
fi
|
2025-01-21 19:57:03 -09:00
|
|
|
skopeo list-tags docker://ghcr.io/{{ repo_organization }}/${image_name} > /tmp/repotags.json
|
|
|
|
|
if [[ $(jq "any(.Tags[]; contains(\"$ver\"))" < /tmp/repotags.json) == "true" ]]; then
|
|
|
|
|
POINT="1"
|
|
|
|
|
while $(jq -e "any(.Tags[]; contains(\"$ver.$POINT\"))" < /tmp/repotags.json)
|
|
|
|
|
do
|
|
|
|
|
(( POINT++ ))
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
if [[ -n "${POINT:-}" ]]; then
|
|
|
|
|
ver="${ver}.$POINT"
|
|
|
|
|
fi
|
2024-11-04 19:13:24 -09:00
|
|
|
|
|
|
|
|
# Build Arguments
|
|
|
|
|
BUILD_ARGS=()
|
2025-10-31 14:40:15 -08:00
|
|
|
# Target
|
|
|
|
|
if [[ "${image}" =~ dx ]]; then
|
|
|
|
|
BUILD_ARGS+=("--build-arg" "IMAGE_FLAVOR=dx")
|
|
|
|
|
target="dx"
|
|
|
|
|
fi
|
2024-11-04 19:13:24 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "AKMODS_FLAVOR=${akmods_flavor}")
|
2026-02-08 05:00:48 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "BASE_IMAGE_ORG=${base_image_org}")
|
2024-11-04 19:13:24 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "BASE_IMAGE_NAME=${base_image_name}")
|
2026-02-08 05:00:48 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "FEDORA_MAJOR_VERSION=${fedora_version}")
|
2025-11-29 05:54:30 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "COMMON_IMAGE={{ common_image }}")
|
|
|
|
|
BUILD_ARGS+=("--build-arg" "COMMON_IMAGE_SHA=${common_image_sha}")
|
2025-12-27 22:09:07 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "BREW_IMAGE={{ brew_image }}")
|
|
|
|
|
BUILD_ARGS+=("--build-arg" "BREW_IMAGE_SHA=${brew_image_sha}")
|
2024-11-04 19:13:24 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${image_name}")
|
|
|
|
|
BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR={{ repo_organization }}")
|
|
|
|
|
BUILD_ARGS+=("--build-arg" "KERNEL=${kernel_release}")
|
2025-01-16 06:42:30 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "VERSION=${ver}")
|
2024-11-10 13:56:21 -09:00
|
|
|
if [[ -z "$(git status -s)" ]]; then
|
2024-11-04 19:13:24 -09:00
|
|
|
BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)")
|
|
|
|
|
fi
|
|
|
|
|
BUILD_ARGS+=("--build-arg" "UBLUE_IMAGE_TAG=${tag}")
|
2025-01-21 19:57:03 -09:00
|
|
|
if [[ "${PODMAN}" =~ docker && "${TERM}" == "dumb" ]]; then
|
|
|
|
|
BUILD_ARGS+=("--progress" "plain")
|
|
|
|
|
fi
|
2024-11-04 19:13:24 -09:00
|
|
|
|
2025-02-04 22:05:36 -09:00
|
|
|
# Pull in most recent upstream base image
|
2025-07-27 14:32:45 -08:00
|
|
|
# if building locally/not ghcr pull the new image
|
2025-02-04 22:05:36 -09:00
|
|
|
if [[ {{ ghcr }} == "0" ]]; then
|
2026-02-08 05:00:48 -09:00
|
|
|
${PODMAN} pull "${base_image_org}/${base_image_name}:${fedora_version}"
|
2025-02-04 22:05:36 -09:00
|
|
|
fi
|
|
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# Labels
|
|
|
|
|
LABELS=()
|
2025-01-21 19:57:03 -09:00
|
|
|
LABELS+=("--label" "containers.bootc=1")
|
2026-05-10 07:26:48 -08:00
|
|
|
LABELS+=("--label" "io.artifacthub.package.deprecated=false")
|
|
|
|
|
LABELS+=("--label" "io.artifacthub.package.keywords=bootc,fedora,aurora,ublue,universal-blue,kde,linux")
|
|
|
|
|
LABELS+=("--label" "io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4")
|
|
|
|
|
LABELS+=("--label" "io.artifacthub.package.maintainers=[{\"name\": \"NiHaiden\", \"email\": \"me@nhaiden.io\"}]")
|
|
|
|
|
LABELS+=("--label" "io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/aurora/refs/heads/main/README.md")
|
2025-01-21 19:57:03 -09:00
|
|
|
LABELS+=("--label" "org.opencontainers.image.created=$(date -u +%Y\-%m\-%d\T%H\:%M\:%S\Z)")
|
2026-05-10 07:26:48 -08:00
|
|
|
LABELS+=("--label" "org.opencontainers.image.description=The ultimate productivity workstation")
|
|
|
|
|
LABELS+=("--label" "org.opencontainers.image.documentation=https://docs.getaurora.dev")
|
|
|
|
|
LABELS+=("--label" "org.opencontainers.image.source=https://raw.githubusercontent.com/ublue-os/aurora/refs/heads/main/Containerfile.in")
|
|
|
|
|
LABELS+=("--label" "org.opencontainers.image.title=${image_name}")
|
2025-01-21 19:57:03 -09:00
|
|
|
LABELS+=("--label" "org.opencontainers.image.url=https://getaurora.dev")
|
|
|
|
|
LABELS+=("--label" "org.opencontainers.image.vendor={{ repo_organization }}")
|
2026-05-10 07:26:48 -08:00
|
|
|
LABELS+=("--label" "org.opencontainers.image.version=${ver}")
|
|
|
|
|
LABELS+=("--label" "ostree.linux=${kernel_release}")
|
2025-01-21 19:57:03 -09:00
|
|
|
|
|
|
|
|
echo "::endgroup::"
|
2026-02-27 08:51:50 -09:00
|
|
|
|
|
|
|
|
case "${akmods_flavor}" in
|
|
|
|
|
"coreos-stable") BUILD_ARGS+=("--cpp-flag=-DZFS") ;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if [[ "${image_name}" =~ nvidia ]]; then
|
|
|
|
|
BUILD_ARGS+=("--cpp-flag=-DNVIDIA")
|
|
|
|
|
fi
|
|
|
|
|
|
2026-05-14 05:53:52 -08:00
|
|
|
# Avoid intermediate image disk writes in CI
|
|
|
|
|
if [[ {{ ghcr }} == "1" ]]; then
|
|
|
|
|
BUILD_ARGS+=("--layers=false")
|
|
|
|
|
fi
|
|
|
|
|
|
2026-02-27 08:51:50 -09:00
|
|
|
PODMAN_BUILD_ARGS=("${BUILD_ARGS[@]}" "${LABELS[@]}" --tag localhost/"${image_name}:${tag}" --file Containerfile.in)
|
2025-07-19 19:02:41 -08:00
|
|
|
|
|
|
|
|
# Add GitHub token secret if available (for CI/CD)
|
|
|
|
|
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
|
|
|
|
|
echo "Adding GitHub token as build secret"
|
|
|
|
|
PODMAN_BUILD_ARGS+=(--secret "id=GITHUB_TOKEN,env=GITHUB_TOKEN")
|
|
|
|
|
else
|
|
|
|
|
echo "No GitHub token found - build may hit rate limit"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
${PODMAN} build "${PODMAN_BUILD_ARGS[@]}" .
|
2025-01-21 19:57:03 -09:00
|
|
|
echo "::endgroup::"
|
2024-05-07 15:51:42 -08:00
|
|
|
|
2025-07-27 14:32:45 -08:00
|
|
|
# Rechunk the image if we are running inside ghcr or set the variable locally
|
2024-11-10 13:56:21 -09:00
|
|
|
if [[ "{{ rechunk }}" == "1" && "{{ ghcr }}" == "1" && "{{ pipeline }}" == "1" ]]; then
|
2025-07-27 14:32:45 -08:00
|
|
|
${SUDOIF} {{ just }} rechunk "${image}" "${tag}" "${flavor}" 1 1
|
2024-11-10 13:56:21 -09:00
|
|
|
elif [[ "{{ rechunk }}" == "1" && "{{ ghcr }}" == "1" ]]; then
|
2025-07-27 14:32:45 -08:00
|
|
|
${SUDOIF} {{ just }} rechunk "${image}" "${tag}" "${flavor}" 1
|
2024-11-10 13:56:21 -09:00
|
|
|
elif [[ "{{ rechunk }}" == "1" ]]; then
|
2026-03-17 06:13:59 -08:00
|
|
|
{{ just }} rechunk "${image}" "${tag}" "${flavor}"
|
2024-11-04 19:13:24 -09:00
|
|
|
fi
|
2024-05-07 15:51:42 -08:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# Build Image and Rechunk
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Image')]
|
2024-12-22 03:15:39 -09:00
|
|
|
build-rechunk image="aurora" tag="latest" flavor="main" kernel_pin="":
|
2025-05-18 23:39:33 -08:00
|
|
|
@{{ just }} build {{ image }} {{ tag }} {{ flavor }} 1 0 0 {{ kernel_pin }}
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Build Image with GHCR Flag
|
2024-11-11 07:01:52 -09:00
|
|
|
[group('Image')]
|
2024-12-22 03:15:39 -09:00
|
|
|
build-ghcr image="aurora" tag="latest" flavor="main" kernel_pin="":
|
2024-11-10 13:56:21 -09:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
if [[ "${UID}" -gt "0" ]]; then
|
|
|
|
|
echo "Must Run with sudo or as root..."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} build {{ image }} {{ tag }} {{ flavor }} 0 1 0 {{ kernel_pin }}
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Build Image for Pipeline:
|
2024-11-11 07:01:52 -09:00
|
|
|
[group('Image')]
|
2024-12-22 03:15:39 -09:00
|
|
|
build-pipeline image="aurora" tag="latest" flavor="main" kernel_pin="":
|
2024-11-10 13:56:21 -09:00
|
|
|
#!/usr/bin/bash
|
2025-05-18 23:39:33 -08:00
|
|
|
${SUDOIF} {{ just }} build {{ image }} {{ tag }} {{ flavor }} 1 1 1 {{ kernel_pin }}
|
2024-05-07 15:51:42 -08:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# Rechunk Image
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Image')]
|
2026-03-31 00:15:04 -08:00
|
|
|
rechunk $image="aurora" $tag="latest" $flavor="main" ghcr="0" pipeline="0" previous_build="0":
|
2024-11-04 19:13:24 -09:00
|
|
|
#!/usr/bin/bash
|
2025-01-21 19:57:03 -09:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
set -eoux pipefail
|
|
|
|
|
|
|
|
|
|
# Validate
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} validate "${image}" "${tag}" "${flavor}"
|
2024-11-04 19:13:24 -09:00
|
|
|
|
|
|
|
|
# Image Name
|
2025-05-18 23:39:33 -08:00
|
|
|
image_name=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
|
2026-03-28 11:59:02 -08:00
|
|
|
fedora_version=$({{ just }} fedora_version '{{ image }}' '{{ tag }}' '{{ flavor }}')
|
2026-03-17 06:13:59 -08:00
|
|
|
DEFAULT_TAG=$({{ just }} generate-default-tag {{ tag }} {{ ghcr }})
|
2024-11-04 19:13:24 -09:00
|
|
|
|
2026-03-17 06:13:59 -08:00
|
|
|
if [[ "{{ ghcr }}" == "0" ]]; then
|
|
|
|
|
{{ just }} load-rootful "${image}" "${tag}" "${flavor}"
|
2024-11-04 19:13:24 -09:00
|
|
|
fi
|
|
|
|
|
|
2026-03-31 00:15:04 -08:00
|
|
|
# TODO: Redo everything here with --previous-build in rpm-ostree 2026.1+
|
|
|
|
|
# so we don't have to pull an old image + rename it
|
|
|
|
|
if [[ "{{ previous_build }}" == "1" ]]; then
|
2026-04-03 12:49:54 -08:00
|
|
|
PREVIOUS_IMAGE=ghcr.io/{{ repo_organization }}/"${image_name}":"${DEFAULT_TAG}"
|
2024-11-10 13:56:21 -09:00
|
|
|
|
2026-04-03 12:49:54 -08:00
|
|
|
# https://github.com/coreos/rpm-ostree/blob/7e2f2065a4aa4d5965b4537bb7d74e0b2898650e/rust/src/compose.rs#L522-L529
|
|
|
|
|
if skopeo inspect docker://"${PREVIOUS_IMAGE}" | jq -e '.LayersData[1:] | all(.Annotations?["ostree.components"]?)'; then
|
|
|
|
|
${SUDOIF} ${PODMAN} pull ${PREVIOUS_IMAGE}
|
|
|
|
|
else
|
|
|
|
|
echo "${PREVIOUS_IMAGE} doesn't exist. Making a fresh layer Plan instead."
|
|
|
|
|
fi
|
2026-03-31 00:15:04 -08:00
|
|
|
fi
|
2025-01-21 19:57:03 -09:00
|
|
|
|
2024-11-10 13:56:21 -09:00
|
|
|
if [[ "{{ ghcr }}" == "1" ]]; then
|
2026-03-31 00:15:04 -08:00
|
|
|
CHUNKED_IMAGE="localhost/"${image_name}":"${DEFAULT_TAG}""
|
|
|
|
|
if [[ "{{ previous_build }}" == "1" ]]; then
|
|
|
|
|
CHUNKED_IMAGE="${PREVIOUS_IMAGE}"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
2026-03-17 06:13:59 -08:00
|
|
|
else
|
2026-03-31 00:15:04 -08:00
|
|
|
# keep the original unrechunked image for local builds
|
2026-03-17 06:13:59 -08:00
|
|
|
CHUNKED_IMAGE="localhost/"${image_name}":"${DEFAULT_TAG}"-chunked"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
2026-03-17 06:13:59 -08:00
|
|
|
# 96 layers, conservative default, same what ci-test is using
|
2026-03-19 09:59:18 -08:00
|
|
|
# one layer is secretly being added for the ostree export
|
2026-03-17 06:13:59 -08:00
|
|
|
# 499 is podman run limit
|
2026-03-19 09:59:18 -08:00
|
|
|
# 128 is docker pull limit
|
2026-03-17 06:13:59 -08:00
|
|
|
# in CI this renames stable to stable-daily
|
2025-01-21 19:57:03 -09:00
|
|
|
${SUDOIF} ${PODMAN} run --rm \
|
|
|
|
|
--pull=${PULL_POLICY} \
|
2026-03-17 06:13:59 -08:00
|
|
|
--privileged \
|
|
|
|
|
-v "/var/lib/containers:/var/lib/containers" \
|
|
|
|
|
--entrypoint /usr/bin/rpm-ostree \
|
|
|
|
|
"${base_image_org}/${base_image_name}:${fedora_version}" \
|
|
|
|
|
compose build-chunked-oci \
|
2026-03-19 09:59:18 -08:00
|
|
|
--max-layers 127 \
|
2026-03-17 06:13:59 -08:00
|
|
|
--format-version=2 \
|
|
|
|
|
--bootc \
|
|
|
|
|
--from "localhost/"${image_name}":"${tag}"" \
|
|
|
|
|
--output containers-storage:${CHUNKED_IMAGE}
|
2024-11-10 13:56:21 -09:00
|
|
|
|
2026-05-11 12:10:01 -08:00
|
|
|
# rename the image to localhost
|
|
|
|
|
if [[ "{{ ghcr }}" == "1" && "{{ previous_build }}" == "1" ]]; then
|
|
|
|
|
${SUDOIF} ${PODMAN} tag ${CHUNKED_IMAGE} "localhost/"${image_name}":"${DEFAULT_TAG}""
|
|
|
|
|
${SUDOIF} ${PODMAN} image rm -f ${CHUNKED_IMAGE}
|
|
|
|
|
fi
|
2024-11-04 19:13:24 -09:00
|
|
|
|
2024-11-10 13:56:21 -09:00
|
|
|
# Pipeline Checks
|
2024-11-11 07:01:52 -09:00
|
|
|
if [[ {{ pipeline }} == "1" && -n "${SUDO_USER:-}" ]]; then
|
2025-05-18 23:39:33 -08:00
|
|
|
sudo -u "${SUDO_USER}" {{ just }} secureboot "${image}" "${tag}" "${flavor}"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
2026-05-09 17:38:55 -08:00
|
|
|
# Rechunk Image but cooler
|
|
|
|
|
[group('Image')]
|
|
|
|
|
chunkah $image="aurora" $tag="latest" $flavor="main" ghcr="0":
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -oeux pipefail
|
|
|
|
|
|
|
|
|
|
{{ just }} validate {{ image }} {{ tag }} {{ flavor }}
|
|
|
|
|
|
|
|
|
|
image_name=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
|
|
|
|
|
DEFAULT_TAG=$({{ just }} generate-default-tag {{ tag }} {{ ghcr }})
|
|
|
|
|
|
|
|
|
|
export CHUNKAH_CONFIG_STR=$(${PODMAN} inspect "${image_name}:${DEFAULT_TAG}")
|
|
|
|
|
${PODMAN} run --rm --mount=type=image,src="${image_name}:${DEFAULT_TAG}",target=/chunkah \
|
|
|
|
|
-e RUST_LOG=debug \
|
|
|
|
|
-e CHUNKAH_CONFIG_STR quay.io/coreos/chunkah:dev \
|
|
|
|
|
build \
|
|
|
|
|
--compressed \
|
|
|
|
|
--max-layers 128 \
|
|
|
|
|
--prune /sysroot/ \
|
|
|
|
|
--label ostree.commit- --label ostree.final-diffid- \
|
|
|
|
|
--tag "${image_name}:${DEFAULT_TAG}" | ${PODMAN} load
|
|
|
|
|
|
2026-03-17 06:13:59 -08:00
|
|
|
# For Rechunk
|
2024-11-11 07:01:52 -09:00
|
|
|
[group('Image')]
|
2026-03-17 06:13:59 -08:00
|
|
|
load-rootful $image="aurora" $tag="latest" $flavor="main":
|
2024-11-11 07:01:52 -09:00
|
|
|
#!/usr/bin/bash
|
2026-03-17 06:13:59 -08:00
|
|
|
set -oux pipefail
|
2024-11-11 07:01:52 -09:00
|
|
|
|
|
|
|
|
# Validate
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} validate {{ image }} {{ tag }} {{ flavor }}
|
2024-11-11 07:01:52 -09:00
|
|
|
|
|
|
|
|
# Image Name
|
2025-05-18 23:39:33 -08:00
|
|
|
image_name=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
|
2024-11-11 07:01:52 -09:00
|
|
|
|
2026-03-17 06:13:59 -08:00
|
|
|
if [[ ! "$(id -u)" == 0 && ! ${PODMAN} =~ docker ]]; then
|
|
|
|
|
ID=$(${PODMAN} images --filter reference=localhost/"${image_name}":"${tag}" --format "'{{ '{{.ID}}' }}'")
|
|
|
|
|
if [[ -z "$ID" ]]; then
|
|
|
|
|
{{ just }} build "$image" "$tag" "$flavor"
|
|
|
|
|
fi
|
|
|
|
|
${PODMAN} image scp localhost/"${image_name}":"${tag}" root@localhost::
|
|
|
|
|
fi
|
2024-11-11 07:01:52 -09:00
|
|
|
|
2026-03-17 06:13:59 -08:00
|
|
|
# Generate OCI Archive for PR Testing
|
|
|
|
|
[group('Image')]
|
|
|
|
|
export-oci $image="aurora" $tag="latest" $flavor="main":
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -oux pipefail
|
|
|
|
|
|
|
|
|
|
# Validate
|
|
|
|
|
{{ just }} validate {{ image }} {{ tag }} {{ flavor }}
|
|
|
|
|
|
|
|
|
|
# Image Name
|
|
|
|
|
image_name=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
|
|
|
|
|
|
2026-03-23 07:46:29 -08:00
|
|
|
${PODMAN} push --compression-format=zstd --compression-level=3 localhost/"${image_name}":"${tag}" oci-archive:"${image_name}".oci
|
2024-11-11 07:01:52 -09:00
|
|
|
|
2024-11-04 19:13:24 -09:00
|
|
|
# Run Container
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Image')]
|
2025-01-02 14:21:43 -09:00
|
|
|
run $image="aurora" $tag="latest" $flavor="main":
|
2024-11-04 19:13:24 -09:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eoux pipefail
|
|
|
|
|
|
|
|
|
|
# Validate
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} validate "${image}" "${tag}" "${flavor}"
|
2024-11-04 19:13:24 -09:00
|
|
|
|
|
|
|
|
# Image Name
|
2025-05-18 23:39:33 -08:00
|
|
|
image_name=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
|
2024-11-04 19:13:24 -09:00
|
|
|
|
|
|
|
|
# Check if image exists
|
2025-01-21 19:57:03 -09:00
|
|
|
ID=$(${PODMAN} images --filter reference=localhost/"${image_name}":"${tag}" --format "'{{ '{{.ID}}' }}'")
|
2024-11-04 19:13:24 -09:00
|
|
|
if [[ -z "$ID" ]]; then
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} build "$image" "$tag" "$flavor"
|
2024-11-04 19:13:24 -09:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Run Container
|
2025-01-21 19:57:03 -09:00
|
|
|
${PODMAN} run -it --rm localhost/"${image_name}":"${tag}" bash
|
2024-11-04 19:13:24 -09:00
|
|
|
|
|
|
|
|
# Test Changelogs
|
2024-11-10 13:56:21 -09:00
|
|
|
[group('Changelogs')]
|
|
|
|
|
changelogs branch="stable" handwritten="":
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eou pipefail
|
|
|
|
|
python3 ./.github/changelogs.py "{{ branch }}" ./output.env ./changelog.md --workdir . --handwritten "{{ handwritten }}"
|
|
|
|
|
|
|
|
|
|
# Verify Container with Cosign
|
|
|
|
|
[group('Utility')]
|
2026-01-24 21:24:40 -09:00
|
|
|
verify-container key="" container="":
|
2024-11-10 13:56:21 -09:00
|
|
|
#!/usr/bin/bash
|
2025-01-21 19:57:03 -09:00
|
|
|
set -eou pipefail
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Get Cosign if Needed
|
|
|
|
|
if [[ ! $(command -v cosign) ]]; then
|
2025-01-21 19:57:03 -09:00
|
|
|
COSIGN_CONTAINER_ID=$(${SUDOIF} ${PODMAN} create cgr.dev/chainguard/cosign:latest bash)
|
|
|
|
|
${SUDOIF} ${PODMAN} cp "${COSIGN_CONTAINER_ID}":/usr/bin/cosign /usr/local/bin/cosign
|
|
|
|
|
${SUDOIF} ${PODMAN} rm -f "${COSIGN_CONTAINER_ID}"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Verify Cosign Image Signatures if needed
|
|
|
|
|
if [[ -n "${COSIGN_CONTAINER_ID:-}" ]]; then
|
|
|
|
|
if ! cosign verify --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main cgr.dev/chainguard/cosign >/dev/null; then
|
|
|
|
|
echo "NOTICE: Failed to verify cosign image signatures."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Verify Container using cosign public key
|
2026-01-24 21:24:40 -09:00
|
|
|
if ! cosign verify --key "{{ key }}" "{{ container }}" >/dev/null; then
|
2024-11-10 13:56:21 -09:00
|
|
|
echo "NOTICE: Verification failed. Please ensure your public key is correct."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Secureboot Check
|
|
|
|
|
[group('Utility')]
|
2025-01-02 14:21:43 -09:00
|
|
|
secureboot $image="aurora" $tag="latest" $flavor="main":
|
2024-05-10 19:34:56 -08:00
|
|
|
#!/usr/bin/bash
|
2025-01-21 19:57:03 -09:00
|
|
|
set -eou pipefail
|
2024-11-10 13:56:21 -09:00
|
|
|
|
2024-11-11 07:01:52 -09:00
|
|
|
# Validate
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} validate "${image}" "${tag}" "${flavor}"
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Image Name
|
2025-05-18 23:39:33 -08:00
|
|
|
image_name=$({{ just }} image_name ${image} ${tag} ${flavor})
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Get the vmlinuz to check
|
2025-01-21 19:57:03 -09:00
|
|
|
kernel_release=$(${PODMAN} inspect "${image_name}":"${tag}" | jq -r '.[].Config.Labels["ostree.linux"]')
|
|
|
|
|
TMP=$(${PODMAN} create "${image_name}":"${tag}" bash)
|
|
|
|
|
${PODMAN} cp "$TMP":/usr/lib/modules/"${kernel_release}"/vmlinuz /tmp/vmlinuz
|
|
|
|
|
${PODMAN} rm "$TMP"
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Get the Public Certificates
|
2025-02-05 09:02:54 -09:00
|
|
|
curl --retry 3 -Lo /tmp/kernel-sign.der https://github.com/ublue-os/akmods/raw/main/certs/public_key.der
|
|
|
|
|
curl --retry 3 -Lo /tmp/akmods.der https://github.com/ublue-os/akmods/raw/main/certs/public_key_2.der
|
2024-11-10 13:56:21 -09:00
|
|
|
openssl x509 -in /tmp/kernel-sign.der -out /tmp/kernel-sign.crt
|
|
|
|
|
openssl x509 -in /tmp/akmods.der -out /tmp/akmods.crt
|
|
|
|
|
|
|
|
|
|
# Make sure we have sbverify
|
2026-05-05 21:12:10 -08:00
|
|
|
CMD="$(command -v sbverify || true)"
|
2024-11-10 13:56:21 -09:00
|
|
|
if [[ -z "${CMD:-}" ]]; then
|
|
|
|
|
temp_name="sbverify-${RANDOM}"
|
2025-01-21 19:57:03 -09:00
|
|
|
${PODMAN} run -dt \
|
2024-11-10 13:56:21 -09:00
|
|
|
--entrypoint /bin/sh \
|
|
|
|
|
--volume /tmp/vmlinuz:/tmp/vmlinuz:z \
|
|
|
|
|
--volume /tmp/kernel-sign.crt:/tmp/kernel-sign.crt:z \
|
|
|
|
|
--volume /tmp/akmods.crt:/tmp/akmods.crt:z \
|
|
|
|
|
--name ${temp_name} \
|
|
|
|
|
alpine:edge
|
2025-01-21 19:57:03 -09:00
|
|
|
${PODMAN} exec ${temp_name} apk add sbsigntool
|
|
|
|
|
CMD="${PODMAN} exec ${temp_name} /usr/bin/sbverify"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Confirm that Signatures Are Good
|
|
|
|
|
$CMD --list /tmp/vmlinuz
|
|
|
|
|
returncode=0
|
|
|
|
|
if ! $CMD --cert /tmp/kernel-sign.crt /tmp/vmlinuz || ! $CMD --cert /tmp/akmods.crt /tmp/vmlinuz; then
|
|
|
|
|
echo "Secureboot Signature Failed...."
|
|
|
|
|
returncode=1
|
|
|
|
|
fi
|
|
|
|
|
if [[ -n "${temp_name:-}" ]]; then
|
2025-01-21 19:57:03 -09:00
|
|
|
${PODMAN} rm -f "${temp_name}"
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
exit "$returncode"
|
|
|
|
|
|
|
|
|
|
# Get Fedora Version of an image
|
|
|
|
|
[group('Utility')]
|
2024-11-11 07:01:52 -09:00
|
|
|
[private]
|
2024-12-22 03:15:39 -09:00
|
|
|
fedora_version image="aurora" tag="latest" flavor="main" $kernel_pin="":
|
2024-11-10 13:56:21 -09:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eou pipefail
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} validate {{ image }} {{ tag }} {{ flavor }}
|
2026-02-01 03:28:38 -09:00
|
|
|
|
2026-03-27 11:42:32 -08:00
|
|
|
# Determine Version
|
|
|
|
|
if [[ "{{ tag }}" =~ stable ]]; then
|
|
|
|
|
VERSION="{{ stable_version }}"
|
|
|
|
|
elif [[ "{{ tag }}" =~ beta ]]; then
|
|
|
|
|
VERSION="{{ beta_version }}"
|
|
|
|
|
else
|
|
|
|
|
VERSION="{{ latest_version }}"
|
2024-11-12 07:57:11 -09:00
|
|
|
fi
|
2026-03-27 11:42:32 -08:00
|
|
|
|
|
|
|
|
echo "${VERSION}"
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Image Name
|
|
|
|
|
[group('Utility')]
|
2024-11-11 07:01:52 -09:00
|
|
|
[private]
|
2024-12-22 03:15:39 -09:00
|
|
|
image_name image="aurora" tag="latest" flavor="main":
|
2024-11-10 13:56:21 -09:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eou pipefail
|
2025-05-18 23:39:33 -08:00
|
|
|
{{ just }} validate {{ image }} {{ tag }} {{ flavor }}
|
2024-11-10 13:56:21 -09:00
|
|
|
if [[ "{{ flavor }}" =~ main ]]; then
|
|
|
|
|
image_name={{ image }}
|
|
|
|
|
else
|
|
|
|
|
image_name="{{ image }}-{{ flavor }}"
|
|
|
|
|
fi
|
|
|
|
|
echo "${image_name}"
|
|
|
|
|
|
|
|
|
|
# Generate Tags
|
|
|
|
|
[group('Utility')]
|
2024-12-22 03:15:39 -09:00
|
|
|
generate-build-tags image="aurora" tag="latest" flavor="main" kernel_pin="" ghcr="0" $version="" github_event="" github_number="":
|
2024-11-10 13:56:21 -09:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eou pipefail
|
2024-11-11 07:01:52 -09:00
|
|
|
|
2024-11-10 13:56:21 -09:00
|
|
|
TODAY="$(date +%A)"
|
2025-11-06 13:28:02 -09:00
|
|
|
WEEKLY="Tuesday"
|
2024-11-10 13:56:21 -09:00
|
|
|
if [[ {{ ghcr }} == "0" ]]; then
|
|
|
|
|
rm -f /tmp/manifest.json
|
|
|
|
|
fi
|
2025-05-18 23:39:33 -08:00
|
|
|
FEDORA_VERSION="$({{ just }} fedora_version '{{ image }}' '{{ tag }}' '{{ flavor }}' '{{ kernel_pin }}')"
|
|
|
|
|
DEFAULT_TAG=$({{ just }} generate-default-tag {{ tag }} {{ ghcr }})
|
|
|
|
|
IMAGE_NAME=$({{ just }} image_name {{ image }} {{ tag }} {{ flavor }})
|
2024-11-11 07:01:52 -09:00
|
|
|
# Use Build Version from Rechunk
|
2024-11-12 20:55:04 -09:00
|
|
|
if [[ -z "${version:-}" ]]; then
|
|
|
|
|
version="{{ tag }}-${FEDORA_VERSION}.$(date +%Y%m%d)"
|
2024-11-11 07:01:52 -09:00
|
|
|
fi
|
2024-11-12 20:55:04 -09:00
|
|
|
version=${version#{{ tag }}-}
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Arrays for Tags
|
|
|
|
|
BUILD_TAGS=()
|
|
|
|
|
COMMIT_TAGS=()
|
|
|
|
|
|
|
|
|
|
# Commit Tags
|
|
|
|
|
github_number="{{ github_number }}"
|
|
|
|
|
SHA_SHORT="$(git rev-parse --short HEAD)"
|
|
|
|
|
if [[ "{{ ghcr }}" == "1" ]]; then
|
2024-11-12 20:55:04 -09:00
|
|
|
COMMIT_TAGS+=(pr-${github_number:-}-{{ tag }}-${version})
|
|
|
|
|
COMMIT_TAGS+=(${SHA_SHORT}-{{ tag }}-${version})
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Convenience Tags
|
|
|
|
|
if [[ "{{ tag }}" =~ stable ]]; then
|
2024-11-12 20:55:04 -09:00
|
|
|
BUILD_TAGS+=("stable-daily" "${version}" "stable-daily-${version}" "stable-daily-${version:3}")
|
2024-11-10 13:56:21 -09:00
|
|
|
else
|
2024-11-12 20:55:04 -09:00
|
|
|
BUILD_TAGS+=("{{ tag }}" "{{ tag }}-${version}" "{{ tag }}-${version:3}")
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Weekly Stable / Rebuild Stable on workflow_dispatch
|
|
|
|
|
github_event="{{ github_event }}"
|
|
|
|
|
if [[ "{{ tag }}" =~ "stable" && "${WEEKLY}" == "${TODAY}" && "${github_event}" =~ schedule ]]; then
|
2024-11-12 20:55:04 -09:00
|
|
|
BUILD_TAGS+=("stable" "stable-${version}" "stable-${version:3}")
|
2024-11-10 13:56:21 -09:00
|
|
|
elif [[ "{{ tag }}" =~ "stable" && "${github_event}" =~ workflow_dispatch|workflow_call ]]; then
|
2024-11-12 20:55:04 -09:00
|
|
|
BUILD_TAGS+=("stable" "stable-${version}" "stable-${version:3}")
|
2024-11-10 13:56:21 -09:00
|
|
|
elif [[ "{{ tag }}" =~ "stable" && "{{ ghcr }}" == "0" ]]; then
|
2024-11-12 20:55:04 -09:00
|
|
|
BUILD_TAGS+=("stable" "stable-${version}" "stable-${version:3}")
|
2024-11-10 13:56:21 -09:00
|
|
|
elif [[ ! "{{ tag }}" =~ stable|beta ]]; then
|
2024-11-12 20:55:04 -09:00
|
|
|
BUILD_TAGS+=("${FEDORA_VERSION}" "${FEDORA_VERSION}-${version}" "${FEDORA_VERSION}-${version:3}")
|
2024-11-10 13:56:21 -09:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ "${github_event}" == "pull_request" ]]; then
|
|
|
|
|
alias_tags=("${COMMIT_TAGS[@]}")
|
|
|
|
|
else
|
|
|
|
|
alias_tags=("${BUILD_TAGS[@]}")
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "${alias_tags[*]}"
|
|
|
|
|
|
|
|
|
|
# Generate Default Tag
|
|
|
|
|
[group('Utility')]
|
|
|
|
|
generate-default-tag tag="latest" ghcr="0":
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eou pipefail
|
|
|
|
|
|
|
|
|
|
# Default Tag
|
|
|
|
|
if [[ "{{ tag }}" =~ stable && "{{ ghcr }}" == "1" ]]; then
|
|
|
|
|
DEFAULT_TAG="stable-daily"
|
|
|
|
|
elif [[ "{{ tag }}" =~ stable && "{{ ghcr }}" == "0" ]]; then
|
|
|
|
|
DEFAULT_TAG="stable"
|
|
|
|
|
else
|
|
|
|
|
DEFAULT_TAG="{{ tag }}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "${DEFAULT_TAG}"
|
|
|
|
|
|
|
|
|
|
# Tag Images
|
|
|
|
|
[group('Utility')]
|
|
|
|
|
tag-images image_name="" default_tag="" tags="":
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eou pipefail
|
|
|
|
|
|
|
|
|
|
# Get Image, and untag
|
2025-01-21 19:57:03 -09:00
|
|
|
IMAGE=$(${PODMAN} inspect localhost/{{ image_name }}:{{ default_tag }} | jq -r .[].Id)
|
|
|
|
|
${PODMAN} untag localhost/{{ image_name }}:{{ default_tag }}
|
2024-11-10 13:56:21 -09:00
|
|
|
|
|
|
|
|
# Tag Image
|
|
|
|
|
for tag in {{ tags }}; do
|
2025-01-21 19:57:03 -09:00
|
|
|
${PODMAN} tag $IMAGE {{ image_name }}:${tag}
|
2024-11-10 13:56:21 -09:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Show Images
|
2025-01-21 19:57:03 -09:00
|
|
|
${PODMAN} images
|
2025-01-28 22:16:35 -09:00
|
|
|
|
2026-05-09 05:00:06 -08:00
|
|
|
# Extract Container and generate SBOM
|
|
|
|
|
[group('Utility')]
|
|
|
|
|
gen-sbom $image="aurora" $tag="latest" $flavor="main" $syft_cmd="syft":
|
|
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eoux pipefail
|
|
|
|
|
|
|
|
|
|
image_name=$({{ just }} image_name '{{ image }}' '{{ tag }}' '{{ flavor }}')
|
|
|
|
|
|
|
|
|
|
OUT_DIR="sbom_out/${image_name}"
|
|
|
|
|
mkdir -p "${OUT_DIR}"
|
|
|
|
|
|
|
|
|
|
# We have to do it this stupid way because we are OOMing on github runners
|
|
|
|
|
# https://github.com/anchore/syft/issues/3800
|
|
|
|
|
${PODMAN} container create --replace --name ${image_name} "${image_name}:${tag}"
|
|
|
|
|
|
|
|
|
|
ROOTFS="${OUT_DIR}/rootfs"
|
|
|
|
|
mkdir -p "${ROOTFS}"
|
|
|
|
|
|
|
|
|
|
${PODMAN} export ${image_name} | tar -C "${ROOTFS}" -xf -
|
|
|
|
|
${PODMAN} container rm ${image_name}
|
|
|
|
|
|
|
|
|
|
SBOM="${OUT_DIR}/sbom.json"
|
|
|
|
|
|
|
|
|
|
${syft_cmd} --source-name "${image_name}:${tag}" "${OUT_DIR}" -o syft-json=${SBOM}
|
|
|
|
|
du -sh "${SBOM}"
|
|
|
|
|
|
|
|
|
|
rm -rf "${ROOTFS}"
|
|
|
|
|
|
2026-03-23 09:26:57 -08:00
|
|
|
# DNF CI package cache
|
|
|
|
|
[group('Utility')]
|
2026-04-09 19:30:58 -08:00
|
|
|
setup-cache $image="aurora" $tag="latest" $flavor="main" $ghcr="0" $github_event="0":
|
2026-03-23 09:26:57 -08:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
set -eou pipefail
|
|
|
|
|
|
2026-04-09 19:30:58 -08:00
|
|
|
image_name=$({{ just }} image_name '{{ image }}' '{{ tag }}' '{{ flavor }}')
|
2026-05-08 07:36:42 -08:00
|
|
|
|
2026-03-25 10:05:08 -08:00
|
|
|
fedora_version=$({{ just }} fedora_version '{{ image }}' '{{ tag }}')
|
2026-03-23 09:26:57 -08:00
|
|
|
|
|
|
|
|
ALLOW_CACHE_WRITE="false"
|
|
|
|
|
|
2026-03-24 09:54:26 -08:00
|
|
|
BLESSED_IMAGE=aurora-dx
|
|
|
|
|
|
|
|
|
|
if [[ "${image_name}" == "${BLESSED_IMAGE}" ]] && \
|
2026-03-23 09:26:57 -08:00
|
|
|
[[ "{{ ghcr }}" == "1" ]] && \
|
|
|
|
|
[[ "${github_event}" == "workflow_dispatch" || "${github_event}" == "schedule" ]]; then
|
|
|
|
|
ALLOW_CACHE_WRITE="true"
|
|
|
|
|
fi
|
|
|
|
|
|
2026-03-24 09:54:26 -08:00
|
|
|
CACHE_NAME="${BLESSED_IMAGE}-${fedora_version}"
|
2026-03-23 09:26:57 -08:00
|
|
|
|
|
|
|
|
echo "${CACHE_NAME}" "${ALLOW_CACHE_WRITE}"
|
|
|
|
|
|
2025-03-01 20:49:59 -09:00
|
|
|
# # Examples:
|
|
|
|
|
# > just retag-nvidia-on-ghcr stable-daily stable-daily-41.20250126.3 0
|
|
|
|
|
# > just retag-nvidia-on-ghcr latest latest-41.20250228.1 0
|
2025-01-28 22:16:35 -09:00
|
|
|
#
|
2025-03-01 20:49:59 -09:00
|
|
|
# working_tag: The tag of the most recent known good image (e.g., stable-daily-41.20250126.3)
|
|
|
|
|
# stream: One of latest, stable-daily, stable or gts
|
|
|
|
|
# dry_run: Only print the skopeo commands instead of running them
|
|
|
|
|
#
|
|
|
|
|
# First generate a PAT with package write access (https://github.com/settings/tokens)
|
|
|
|
|
# and set $GITHUB_USERNAME and $GITHUB_PAT environment variables
|
2025-01-28 22:16:35 -09:00
|
|
|
|
|
|
|
|
# Retag images on GHCR
|
|
|
|
|
[group('Admin')]
|
2025-03-01 20:49:59 -09:00
|
|
|
retag-nvidia-on-ghcr working_tag="" stream="" dry_run="1":
|
2025-01-28 22:16:35 -09:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
skopeo="echo === skopeo"
|
|
|
|
|
if [[ "{{ dry_run }}" -ne 1 ]]; then
|
|
|
|
|
echo "$GITHUB_PAT" | podman login -u $GITHUB_USERNAME --password-stdin ghcr.io
|
|
|
|
|
skopeo="skopeo"
|
|
|
|
|
fi
|
2025-10-24 11:11:49 -08:00
|
|
|
for image in aurora-nvidia-open aurora-dx-nvidia-open; do
|
2025-03-01 20:49:59 -09:00
|
|
|
$skopeo copy docker://ghcr.io/ublue-os/${image}:{{ working_tag }} docker://ghcr.io/ublue-os/${image}:{{ stream }}
|
2025-01-28 22:16:35 -09:00
|
|
|
done
|