Skip to content

Commit

Permalink
send details of package sha contents to stderr for debugability
Browse files Browse the repository at this point in the history
(cherry picked from commit 191927d)
  • Loading branch information
craigcomstock committed Aug 24, 2023
1 parent c418beb commit 12ed25c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ci/package-sha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ COMPUTED_ROOT="$(readlink -e "$(dirname "$0")/../../")"
NTECH_ROOT=${NTECH_ROOT:-$COMPUTED_ROOT}

CORE_SHA=$(git -C "${NTECH_ROOT}/core" log --pretty='format:%h' -1 -- .)
echo "CORE_SHA: ${CORE_SHA}" >&2
ENTERPRISE_SHA=$(git -C "${NTECH_ROOT}/enterprise" log --pretty='format:%h' -1 -- .)
echo "ENTERPRISE_SHA: ${ENTERPRISE_SHA}" >&2
NOVA_SHA=$(git -C "${NTECH_ROOT}/nova" log --pretty='format:%h' -1 -- .)
echo "NOVA_SHA: ${NOVA_SHA}" >&2
MASTERFILES_SHA=$(git -C "${NTECH_ROOT}/masterfiles" log --pretty='format:%h' -1 -- .)
echo "MASTERFILES_SHA: ${MASTERFILES_SHA}" >&2
# notice below the sha is more complex, a todo is to make "code only" shas for each repo ENT-10443
MISSION_PORTAL_SHA=$(find "${NTECH_ROOT}/mission-portal" -type f -and \( -path "./application/*" -or -path "./public/*" -or -path "./phpcfenginenova/*" -or -path "./ldap/*" -or -path "./composer.json" -or -path "./package.json" -or -path "./static/*" \) -print0 | xargs -0 sha1sum | awk '{print $1}' | sha1sum | cut -c -8)
echo "MISSION_PORTAL_SHA: ${MISSION_PORTAL_SHA}" >&2
BUILDSCRIPTS_SHA=$(find "${NTECH_ROOT}/buildscripts" -type f -and \( -path "./deps-packaging/*" -or -path "./build-scripts/*" -or -path "./packaging/*" \) -print0 | xargs -0 sha1sum | awk '{print $1}' | sha1sum | cut -c -8)
echo "BUILDSCRIPTS_SHA: ${BUILDSCRIPTS_SHA}" >&2

PACKAGE_SHA=$(echo "$CORE_SHA" "$ENTERPRISE_SHA" "$NOVA_SHA" "$MASTERFILES_SHA" "$MISSION_PORTAL_SHA" "$BUILDSCRIPTS_SHA" | sha256sum | cut -d' ' -f1 | cut -c -8)
echo "$PACKAGE_SHA"

0 comments on commit 12ed25c

Please sign in to comment.