Skip to content

Commit

Permalink
Add make targets to generate release files checksums (strimzi#6119)
Browse files Browse the repository at this point in the history
* Add make targets to generate release files checksums

Signed-off-by: Jakub Scholz <www@scholzj.com>

* Do not print entering and leaving directory messages

Signed-off-by: Jakub Scholz <www@scholzj.com>
  • Loading branch information
scholzj authored Dec 31, 2021
1 parent 53d07a5 commit 8b7907c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .azure/scripts/release_files_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ SHA1SUM=sha1sum
RETURN_CODE=0

# Helm Charts
CHECKSUM="$(find ./helm-charts/ -type f -print0 | sort -z | xargs -0 ${SHA1SUM} | ${SHA1SUM})"
echo "checksum of ./helm-charts/ is CHECKSUM=${CHECKSUM}"
CHECKSUM="$(make --no-print-directory checksum_helm)"

if [ "$CHECKSUM" != "$HELM_CHART_CHECKSUM" ]; then
echo "ERROR checksum of ./helm-charts does not match expected"
Expand All @@ -24,12 +23,13 @@ if [ "$CHECKSUM" != "$HELM_CHART_CHECKSUM" ]; then
echo "->"
echo "HELM_CHART_CHECKSUM=\"${CHECKSUM}\""
RETURN_CODE=$((RETURN_CODE+1))
else
echo "checksum of ./helm-charts/ matches expected checksum => OK"
fi


# install
CHECKSUM="$(find ./install/ -type f -print0 | sort -z | xargs -0 ${SHA1SUM} | ${SHA1SUM})"
echo "checksum of ./install/ is CHECKSUM=${CHECKSUM}"
CHECKSUM="$(make --no-print-directory checksum_install)"

if [ "$CHECKSUM" != "$INSTALL_CHECKSUM" ]; then
echo "ERROR checksum of ./install does not match expected"
Expand All @@ -44,11 +44,12 @@ if [ "$CHECKSUM" != "$INSTALL_CHECKSUM" ]; then
echo "->"
echo "INSTALL_CHECKSUM=\"${CHECKSUM}\""
RETURN_CODE=$((RETURN_CODE+1))
else
echo "checksum of ./install/ matches expected checksum => OK"
fi

# examples
CHECKSUM="$(find ./examples/ -type f -print0 | sort -z | xargs -0 ${SHA1SUM} | ${SHA1SUM})"
echo "checksum of ./examples/ is CHECKSUM=${CHECKSUM}"
CHECKSUM="$(make --no-print-directory checksum_examples)"

if [ "$CHECKSUM" != "$EXAMPLES_CHECKSUM" ]; then
echo "ERROR checksum of ./install does not match expected"
Expand All @@ -63,6 +64,8 @@ if [ "$CHECKSUM" != "$EXAMPLES_CHECKSUM" ]; then
echo "->"
echo "EXAMPLES_CHECKSUM=\"${CHECKSUM}\""
RETURN_CODE=$((RETURN_CODE+1))
else
echo "checksum of ./examples/ matches expected checksum => OK"
fi

exit $RETURN_CODE
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,13 @@ systemtest_make:
prerequisites_check:
SED=$(SED) ./tools/prerequisites-check.sh

checksum_examples:
@$(FIND) ./examples/ -type f -print0 | $(SORT) -z | $(XARGS) -0 $(SHA1SUM) | $(SHA1SUM)

checksum_install:
@$(FIND) ./install/ -type f -print0 | $(SORT) -z | $(XARGS) -0 $(SHA1SUM) | $(SHA1SUM)

checksum_helm:
@$(FIND) ./helm-charts/ -type f -print0 | $(SORT) -z | $(XARGS) -0 $(SHA1SUM) | $(SHA1SUM)

.PHONY: all $(SUBDIRS) $(DOCKERDIRS) $(DOCKER_TARGETS) systemtests docu_versions spotbugs docu_check prerequisites_check
2 changes: 2 additions & 0 deletions Makefile.os
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CP = cp
UNIQ = uniq
SORT = sort
SHA1SUM = sha1sum
XARGS = xargs

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
Expand All @@ -15,4 +16,5 @@ ifeq ($(UNAME_S),Darwin)
UNIQ = guniq
SORT = gsort
SHA1SUM = gsha1sum
XARGS = gxargs
endif

0 comments on commit 8b7907c

Please sign in to comment.