Skip to content

Commit

Permalink
Merge pull request #67 from kubevirt-bot/cherry-pick-62-to-release-v1.2
Browse files Browse the repository at this point in the history
[release-v1.2] Add requirement for release tool for safe publishing
  • Loading branch information
kubevirt-bot authored May 7, 2024
2 parents ed6497d + f854f7a commit 1b9fe7b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions hack/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

source $(dirname "$0")/build/common.sh
source $(dirname "$0")/build/config.sh

set -e

if [ -z "${AAQ_CRI}" ]; then
echo >&2 "no working container runtime found. Neither docker nor podman seems to work."
exit 1
fi

if [ -z ${GPG_PRIVATE_KEY_FILE} ]; then
echo "GPG_PRIVATE_KEY_FILE env var must be set"
exit 1
elif [ -z ${GPG_PASSPHRASE_FILE} ]; then
echo "GPG_PASSPHRASE_FILE env var must be set"
exit 1
elif [ -z ${GITHUB_API_TOKEN_FILE} ]; then
echo "GITHUB_API_TOKEN_FILE env var must be set"
exit 1
fi

GIT_USER=${GIT_USER:-$(git config user.name)}
GIT_EMAIL=${GIT_EMAIL:-$(git config user.email)}

echo "git user: $GIT_USER"
echo "git email: $GIT_EMAIL"

${AAQ_CRI} pull quay.io/kubevirtci/release-tool:latest

echo "${AAQ_CRI} run -it --rm \
-v ${GPG_PRIVATE_KEY_FILE}:/home/releaser/gpg-private \
-v ${GPG_PASSPHRASE_FILE}:/home/releaser/gpg-passphrase \
-v ${GITHUB_API_TOKEN_FILE}:/home/releaser/github-api-token \
-v /home/.gitconfig:/home/releaser/.gitconfig \
quay.io/kubevirtci/release-tool:latest \
--org=kubevirt \
--repo=application-aware-quota \
--git-email \"${GIT_EMAIL}\" \
--git-user \"${GIT_USER}\"
\"$@\""

${AAQ_CRI} run -it --rm \
-v ${GPG_PRIVATE_KEY_FILE}:/home/releaser/gpg-private \
-v ${GPG_PASSPHRASE_FILE}:/home/releaser/gpg-passphrase \
-v ${GITHUB_API_TOKEN_FILE}:/home/releaser/github-api-token \
-v /home/.gitconfig:/home/.gitconfig \
quay.io/kubevirtci/release-tool:latest \
--org=kubevirt \
--repo=application-aware-quota \
--git-email "${GIT_EMAIL}" \
--git-user "${GIT_USER}" \
"$@"

0 comments on commit 1b9fe7b

Please sign in to comment.