diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-08-26 17:29:49 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-08-26 17:31:15 +0800 |
| commit | 8f9bc7c6133f466355e5538e066379e7f3366ae4 (patch) | |
| tree | 6fb288b035999b8838acf36c579b3e1926c293b2 /Justfile | |
| parent | 455dddfcc4f4a8bdf9f2761b52434a43c878dc21 (diff) | |
| download | AeroCore-OS-8f9bc7c6133f466355e5538e066379e7f3366ae4.tar.gz AeroCore-OS-8f9bc7c6133f466355e5538e066379e7f3366ae4.zip | |
fix: align testing channel metadata
Make the build tag authoritative for image branch and version metadata.
Avoid hard-coded stable image tags and add regression coverage.
Diffstat (limited to 'Justfile')
| -rw-r--r-- | Justfile | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -130,7 +130,17 @@ build $target_image=image_name $tag=default_tag: BUILD_ARGS=() LABELS=() - for arg in BASE_IMAGE IMAGE_BRANCH VERSION_TAG VERSION_PRETTY FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do + # The recipe tag is the channel selected by commands such as + # `just build localhost/aerocore-os testing`. Keep the image's internal + # channel/version metadata aligned with that tag instead of allowing a + # stale dotenv value (for example, `stable`) to leak into the image. + BUILD_CHANNEL_ARGS=( + "--build-arg" "IMAGE_BRANCH={{ tag }}" + "--build-arg" "VERSION_TAG={{ tag }}" + "--build-arg" "VERSION_PRETTY={{ tag }}" + ) + + for arg in BASE_IMAGE FLATPAK_REMOTE_URL HOMEBREW_BOTTLE_DOMAIN HOMEBREW_API_DOMAIN OSTREE_IMAGE_REF INSTRUMENTS_ENABLED INSTRUMENTS_RELEASE_REPOSITORY INSTRUMENTS_VERSION INSTRUMENTS_RELEASE_API_BASE; do if [[ -n "${!arg:-}" ]]; then BUILD_ARGS+=("--build-arg" "${arg}=${!arg}") fi @@ -142,7 +152,7 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.documentation=https://raw.githubusercontent.com/{{ repo_organization }}/{{ image_name }}/${GIT_SHA}/README.md") LABELS+=("--label" "org.opencontainers.image.source=https://github.com/{{ repo_organization }}/{{ image_name }}/blob/${GIT_SHA}/Containerfile") LABELS+=("--label" "org.opencontainers.image.url=https://github.com/{{ repo_organization }}/{{ image_name }}/tree/${GIT_SHA}") - LABELS+=("--label" "org.opencontainers.image.version={{ VERSION_TAG }}-${GIT_SHA}") + LABELS+=("--label" "org.opencontainers.image.version={{ tag }}-${GIT_SHA}") fi # Image metadata for https://artifacthub.io/ - This is optional but is highly recommended so we all can get a index of all the custom images @@ -158,7 +168,7 @@ build $target_image=image_name $tag=default_tag: LABELS+=("--label" "org.opencontainers.image.vendor={{ repo_organization }}") # This actually builds the image! - PODMAN_BUILD_ARGS=("${BUILD_ARGS[@]}" "${LABELS[@]}" --pull=newer --tag "${target_image}:${tag}" --file Containerfile) + PODMAN_BUILD_ARGS=("${BUILD_CHANNEL_ARGS[@]}" "${BUILD_ARGS[@]}" "${LABELS[@]}" --pull=newer --tag "${target_image}:${tag}" --file Containerfile) podman build "${PODMAN_BUILD_ARGS[@]}" . |
