Skip to content

Commit 1ed59d5

Browse files
committed
improve upload
1 parent 22dbf94 commit 1ed59d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nifi/upload_new_nifi_version.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ curl --fail -LOs "${download_url}/${src_file}.sha512"
4141

4242
# It is probably redundant to check both the checksum and the signature but it's cheap and why not
4343
echo "Validating SHA512 Checksums"
44-
if ! (sha512sum "$src_file" | cut -d ' ' -f 1 | tr -d '\n' | diff - "$src_file.sha512"); then
44+
# The '<(echo -e $(<${src_file}.sha512))' part removes possible new lines in the provided .sha512 file.
45+
# This is due to the NiFi sha512 files sometimes ending on newline and sometimes dont.
46+
# See https://archive.apache.org/dist/nifi/2.0.0/nifi-2.0.0-source-release.zip.sha512 vs
47+
# https://archive.apache.org/dist/nifi/1.27.0/nifi-1.27.0-source-release.zip.sha512
48+
if ! (sha512sum "$src_file" | cut -d ' ' -f 1 | diff - <(echo -e $(<${src_file}.sha512))); then
4549
echo "ERROR: One of the SHA512 sums does not match"
4650
exit 1
4751
fi
@@ -54,6 +58,8 @@ if ! (gpg --verify "$src_file.asc" "$src_file" 2> /dev/null); then
5458
exit 1
5559
fi
5660

61+
exit 0
62+
5763
echo "Uploading everything to Nexus"
5864
EXIT_STATUS=0
5965
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "${src_file}" 'https://repo.stackable.tech/repository/packages/nifi/' || EXIT_STATUS=$?

0 commit comments

Comments
 (0)