-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: add custom private key option for release.sh #14401
Conversation
Oh nice! Thanks! As I said I'm not this familiar with bash but I can certainly try using this for 8.2.1 (#14399). |
I think the main thing would be to ensure this works with |
ah, didn't notice |
So, I used this for 8.2.1 and it worked just fine! 😄 (I did not need to use |
Nice work @krydos! It'd be nice to do -s in the same way but that's not a big deal. I'll review and test shortly and be back with feedback. |
so could you try pulling the |
Sure, I'll try to convert |
c0b8c45
to
3648684
Compare
I've changed how Previously in case nothing is passed to And again, I tried to debug it with multiple echo statements but I was unable to debug if script in a whole works correctly or not. |
Hmm, the script doesn't actually seem to run now? All variants with valid options just seem to return from the script without doing anything. :/ |
3648684
to
8f6897f
Compare
ah, excuse me, I didn't really get the purpose of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I promoted the armv6 binaries for 8.2.1 with the latest version of this.
Both -i
and -s
worked just fine. I wasn't able to test without -i
though.
@nodejs/build & @jasnell can someone with |
tools/release.sh
Outdated
signversion="${OPTARG}" | ||
;; | ||
\?) | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want a nicer error message you can do this:
diff --git a/tools/release.sh b/tools/release.sh
index 4225be4cc7..fcb5ef1242 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -16,7 +16,7 @@ signcmd=dist-sign
customsshkey="" # let ssh and scp use default key
signversion=""
-while getopts "i:s:" option; do
+while getopts ":i:s:" option; do
case "${option}" in
i)
customsshkey="-i ${OPTARG}"
@@ -25,6 +25,11 @@ while getopts "i:s:" option; do
signversion="${OPTARG}"
;;
\?)
+ echo "Invalid option -$OPTARG."
+ exit 1
+ ;;
+ :)
+ echo "Option -$OPTARG takes a parameter."
exit 1
;;
esac
up to you whether it's worth it though.
@Fishrock123 FWIW you can add the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine with or without the proposed fix.
8f6897f
to
f24235b
Compare
@gibfahn thank you for the help. I didn't know that colon at the beginning of the arguments definition switch getopts to |
Add -i option for release.sh that allows user to specify non-default private key for ssh and scp commands. Change argument parsing to getopts.
f24235b
to
688d22e
Compare
Landed in 237a42d |
Add -i option for release.sh that allows users to specify non-default private key for ssh and scp commands. Change argument parsing to getopts. PR-URL: #14401 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Add -i option for release.sh that allows users to specify non-default private key for ssh and scp commands. Change argument parsing to getopts. PR-URL: nodejs/node#14401 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Add -i option for release.sh that allows users to specify non-default private key for ssh and scp commands. Change argument parsing to getopts. PR-URL: nodejs/node#14401 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Add -i option for release.sh that allows users to specify non-default private key for ssh and scp commands. Change argument parsing to getopts. PR-URL: #14401 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Add -i option for release.sh that allows users to specify non-default private key for ssh and scp commands. Change argument parsing to getopts. PR-URL: #14401 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Add -i option for release.sh that allows users to specify non-default private key for ssh and scp commands. Change argument parsing to getopts. PR-URL: #14401 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Hi,
I just noticed issue here - #14378 and tried to solve it.
So I've added
-i
option forrelease.sh
that allows user to specify non-default private key forssh
andscp
commands.I've tested script manually with some debug
echo
statements since I'm not sure we have any tests for our tools (or idk about them).One more thing is
shift $((OPTIND-1))
right after while loop. It's important to save variable such as$1
,$2
etc, that are used in the script. So these variables should not be broken.If anyone could help me to test this script it would be great :)
Checklist
Affected core subsystem(s)
tools