From 44ef66ee2a38bf0c74313e5fa664e273c4070653 Mon Sep 17 00:00:00 2001 From: m2Giles <69128853+m2Giles@users.noreply.github.com> Date: Tue, 14 May 2024 13:08:02 +0000 Subject: [PATCH] feat: add git branch to image/iso tags --- scripts/build-iso-ghcr.sh | 6 ------ scripts/build-iso-installer-main.sh | 6 ------ scripts/build-iso.sh | 6 ------ scripts/common-build-iso.sh | 9 +++++++-- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/scripts/build-iso-ghcr.sh b/scripts/build-iso-ghcr.sh index 2d53fa38a46..6e959af5f85 100755 --- a/scripts/build-iso-ghcr.sh +++ b/scripts/build-iso-ghcr.sh @@ -4,17 +4,11 @@ if [[ -z ${project_root} ]]; then project_root=$(git rev-parse --show-toplevel) fi -# shellcheck disable=SC1091 -. "${project_root}/scripts/sudoif.sh" # Common Build ISO # shellcheck disable=SC2154,SC1091 . "${project_root}/scripts/common-build-iso.sh" -# Remove old ISO if present -sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-ghcr.iso" -sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-ghcr.iso-CHECKSUM" - # Make ISO ${container_mgr} run --rm --privileged \ --volume "${workspace}"/scripts/files/output:/build-container-installer/build \ diff --git a/scripts/build-iso-installer-main.sh b/scripts/build-iso-installer-main.sh index 6bf108579a1..d96bea41f49 100644 --- a/scripts/build-iso-installer-main.sh +++ b/scripts/build-iso-installer-main.sh @@ -7,17 +7,11 @@ fi if [[ -z ${git_branch} ]]; then git_branch=$(git branch --show-current) fi -# shellcheck disable=SC1091 -. "${project_root}/scripts/sudoif.sh" # Common Build ISO # shellcheck disable=SC1091 . "${project_root}/scripts/common-build-iso.sh" -# Remove old ISO if present -sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso" -sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso-CHECKSUM" - if [[ ${container_mgr} =~ "podman" ]]; then api_socket=/run/podman/podman.sock elif [[ ${container_mgr} =~ "docker" ]]; then diff --git a/scripts/build-iso.sh b/scripts/build-iso.sh index 3d0e4c6fa04..e0f839b7cca 100755 --- a/scripts/build-iso.sh +++ b/scripts/build-iso.sh @@ -7,17 +7,11 @@ fi if [[ -z ${git_branch} ]]; then git_branch=$(git branch --show-current) fi -# shellcheck disable=SC1091 -. "${project_root}/scripts/sudoif.sh" # Common Build ISO # shellcheck disable=SC1091 . "${project_root}/scripts/common-build-iso.sh" -# Remove old ISO if present -sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso" -sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso-CHECKSUM" - if [[ ${container_mgr} =~ "podman" ]]; then api_socket=/run/podman/podman.sock elif [[ ${container_mgr} =~ "docker" ]]; then diff --git a/scripts/common-build-iso.sh b/scripts/common-build-iso.sh index 54956c4f8d4..5d0306c9959 100644 --- a/scripts/common-build-iso.sh +++ b/scripts/common-build-iso.sh @@ -1,6 +1,9 @@ #!/usr/bin/bash #shellcheck disable=SC2154,SC2034 +# shellcheck disable=SC1091 +. "${project_root}/scripts/sudoif.sh" + # Check if inside rootless container if [[ -f /run/.containerenv ]]; then #shellcheck disable=SC1091 @@ -42,7 +45,9 @@ tag=$(just _tag "${image}" "${target}") # Don't use -build suffix, flatpak dependency using ghcr ghcr_tag=${tag::-6} - +# Remove old ISO if present +sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso" +sudoif rm -f "${project_root}/scripts/files/output/${tag}-${version}-${git_branch}.iso-CHECKSUM" # Set Base Image base_image=$(just _base_image "${image}") @@ -59,7 +64,7 @@ else fi # Make sure image actually exists, build if it doesn't -ID=$(${container_mgr} images --filter reference=localhost/"${tag}":"${version}" --format "{{.ID}}") +ID=$(${container_mgr} images --filter reference=localhost/"${tag}:${version}-${git_branch}" --format "{{.ID}}") if [[ -z ${ID} ]]; then just build "${image}" "${target}" "${version}" fi