Skip to content

Commit

Permalink
scripts/release: list GPG key only when tagging is needed
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
  • Loading branch information
gyuho committed Oct 23, 2019
1 parent 3cf2f69 commit 1e98c96
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ main() {
exit 1
fi

KEYID=$(gpg --list-keys --with-colons| awk -F: '/^pub:/ { print $5 }')
if [[ -z "${KEYID}" ]]; then
echo "Failed to load gpg key. Is gpg set up correctly for etcd releases?"
exit 1
fi

# Expected umask for etcd release artifacts
umask 022

Expand Down Expand Up @@ -116,6 +110,11 @@ main() {
echo "Skipping tag step. git tag ${RELEASE_VERSION} already exists."
else
echo "Tagging release..."
KEYID=$(gpg --list-keys --with-colons| awk -F: '/^pub:/ { print $5 }')
if [[ -z "${KEYID}" ]]; then
echo "Failed to load gpg key. Is gpg set up correctly for etcd releases?"
exit 1
fi
git tag --local-user "${KEYID}" --sign "${RELEASE_VERSION}" --message "${RELEASE_VERSION}"
fi

Expand Down

0 comments on commit 1e98c96

Please sign in to comment.