Skip to content

Commit

Permalink
feat: add git branch to image/iso tags
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed May 14, 2024
1 parent bc9a3ec commit 44ef66e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
6 changes: 0 additions & 6 deletions scripts/build-iso-ghcr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 0 additions & 6 deletions scripts/build-iso-installer-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions scripts/build-iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions scripts/common-build-iso.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}")
Expand All @@ -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
Expand Down

0 comments on commit 44ef66e

Please sign in to comment.