tools: add custom private key option for release.sh#14401
tools: add custom private key option for release.sh#14401krydos wants to merge 1 commit intonodejs:masterfrom
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 |
Fishrock123
left a comment
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
gibfahn
left a comment
There was a problem hiding this comment.
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 <fishrock123@rocketmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
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 <fishrock123@rocketmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
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 <fishrock123@rocketmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
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 <fishrock123@rocketmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
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 <fishrock123@rocketmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
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 <fishrock123@rocketmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Hi,
I just noticed issue here - #14378 and tried to solve it.
So I've added
-ioption forrelease.shthat allows user to specify non-default private key forsshandscpcommands.I've tested script manually with some debug
echostatements 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,$2etc, 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