Skip to content

Commit

Permalink
Use a parameter for GPG key
Browse files Browse the repository at this point in the history
  • Loading branch information
stggn committed Nov 15, 2023
1 parent 12a9576 commit 7c9688e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion warp10/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ task pack(type: Jar) {
//
task createTarArchive(type: Exec, dependsOn: pack) {
workingDir '.'
commandLine "${projectDir}/src/main/sh/package.sh", version, projectDir
commandLine "${projectDir}/src/main/sh/package.sh", version, projectDir, project.getProperties().get("signing.gnupg.keyName")
outputs.file "${buildDir}/libs/warp10-${version}.tar.gz"
}

Expand Down
12 changes: 9 additions & 3 deletions warp10/src/main/sh/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,28 @@ set -eu

VERSION=$1
if [ -z "${VERSION:+x}" ]; then
echo "Usage: $0 VERSION WARP_ROOT_PATH"
echo "Usage: $0 VERSION WARP_ROOT_PATH GPG_KEY_NAME"
exit 1
fi
WARP10_HOME=warp10-${VERSION}

# Warp 10 root project path (../warp10)
WARP_ROOT_PATH=$2
if [ -z "${WARP_ROOT_PATH:+x}" ]; then
echo "Usage: $0 VERSION WARP_ROOT_PATH"
echo "Usage: $0 VERSION WARP_ROOT_PATH GPG_KEY_NAME"
exit 1
fi
if [ ! -d "${WARP_ROOT_PATH}" ]; then
echo "${WARP_ROOT_PATH} folder does not exist."
exit 1
fi

GPG_KEY_NAME=$3
if [ -z "${GPG_KEY_NAME:+x}" ]; then
echo "Usage: $0 VERSION WARP_ROOT_PATH GPG_KEY_NAME"
exit 1
fi

ARCHIVE=${WARP_ROOT_PATH}/archive

# Remove existing archive dir
Expand Down Expand Up @@ -117,7 +123,7 @@ FILE=../build/libs/warp10-${VERSION}.tar.gz
tar czpf "${FILE}" "${WARP10_HOME}"

# Generate signature
gpg --local-user BD49DA0A --output "${FILE}".asc --detach-sign "${FILE}"
gpg --local-user "${GPG_KEY_NAME}" --output "${FILE}".asc --detach-sign "${FILE}"

# Generate hash
sha512sum "${FILE}" | sed -e "s@ .*/@ @" > "${FILE}".sha512
Expand Down

0 comments on commit 7c9688e

Please sign in to comment.