Created
May 26, 2022 23:04
-
-
Save askb/eab6b21b3127e9da2c780673da23ec81 to your computer and use it in GitHub Desktop.
sigul-sign.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to run the sigul signing within the docker image | |
set -x | |
echo "Sign files in: $SIGN_DIR" | |
set -e # Fail immediately if any if signing fails | |
find "${SIGN_DIR}" -type f ! -name "*.asc" \ | |
! -name "*.md5" \ | |
! -name "*.sha1" \ | |
! -name "_maven.repositories" \ | |
! -name "_remote.repositories" \ | |
! -name "*.lastUpdated" \ | |
! -name "maven-metadata-local.xml" \ | |
! -name "maven-metadata.xml" > ${WORKSPACE}/sign.lst | |
if [ -s ${WORKSPACE}/sign.lst ]; then | |
echo "Sign list is not empty" | |
fi | |
files_to_sign=() | |
while IFS= read -rd $'\n' line; do | |
files_to_sign+=("$line") | |
sigul --batch -c "${SIGUL_CONFIG}" sign-data -a -o "${line}.asc" "${SIGUL_KEY}" "${line}" < "${SIGUL_PASSWORD}" | |
done < ${WORKSPACE}/sign.lst | |
if [ "${#files_to_sign[@]}" -eq 0 ]; then | |
echo "ERROR: No files to sign. Quitting..." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment