-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts/prepare-release: option -k to specify the signing key
Make the GPG signing an optional argument. It doesn't make much sense to require that when no assets are being generated (i.e. when "-b" is used).
- Loading branch information
Showing
1 changed file
with
11 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,21 @@ this=`basename $0` | |
|
||
usage () { | ||
cat << EOF | ||
Usage: $this [-h] [-a] [-b] RELEASE_VERSION GPG_KEY | ||
Usage: $this [-h] [-a] [-b] [-k GPG_KEY] RELEASE_VERSION | ||
Options: | ||
-h show this help and exit | ||
-a do not patch files in the repo | ||
-b do not generate assets | ||
-k gpg key to use for signing the assets | ||
Example: | ||
$this v0.1.2 "Jane Doe <[email protected]>" | ||
$this v0.1.2 -k "Jane Doe <[email protected]>" | ||
NOTE: The GPG key should be associated with the signer's Github account. | ||
Use -k to specify the correct key (if needed). | ||
EOF | ||
} | ||
|
||
|
@@ -29,20 +31,22 @@ sign_helm_chart() { | |
echo "$yaml | ||
... | ||
files: | ||
$chart: sha256:$sha256" | gpg -u "$key" --clearsign -o "$chart.prov" | ||
$chart: sha256:$sha256" | gpg ${signing_key:+-u "$signing_key"} --clearsign -o "$chart.prov" | ||
} | ||
|
||
# | ||
# Parse command line | ||
# | ||
no_patching= | ||
no_assets= | ||
while getopts "abh" opt; do | ||
while getopts "abk:h" opt; do | ||
case $opt in | ||
a) no_patching=y | ||
;; | ||
b) no_assets=y | ||
;; | ||
k) signing_key="$OPTARG" | ||
;; | ||
h) usage | ||
exit 0 | ||
;; | ||
|
@@ -54,8 +58,8 @@ done | |
shift "$((OPTIND - 1))" | ||
|
||
# Check that no extra args were provided | ||
if [ $# -ne 2 ]; then | ||
if [ $# -lt 2 ]; then | ||
if [ $# -ne 1 ]; then | ||
if [ $# -lt 1 ]; then | ||
echo -e "ERROR: too few arguments\n" | ||
else | ||
echo -e "ERROR: unknown arguments: ${@:3}\n" | ||
|
@@ -65,8 +69,7 @@ if [ $# -ne 2 ]; then | |
fi | ||
|
||
release=$1 | ||
key="$2" | ||
shift 2 | ||
shift 1 | ||
|
||
container_image=k8s.gcr.io/nfd/node-feature-discovery:$release | ||
|
||
|