forked from graphql/graphiql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
npm-publish.sh
executable file
·30 lines (26 loc) · 925 Bytes
/
npm-publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# config npm
echo '---> Set npm registry to Jukwaa private npm ...'
npm set registry http://localhost:4873
npm config set @types:registry https://registry.npmjs.org/
currentRegistry=$(npm get registry)
echo "---> current regisry is: $currentRegistry ..."
# get uer name
USERNAME=$USER
while true; do
read -p "---> is ${USERNAME} your username (y/n): " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo -n '---> please input your username: '; read INPUTUSERNAME; USERNAME=$INPUTUSERNAME; break;;
* ) echo "---> Please answer y or n: ";;
esac
done
# tunneling
REMOTEHOST=localhost
REMOTEPORT=4873
TIMEOUT=1
if nc -w $TIMEOUT -z $REMOTEHOST $REMOTEPORT; then
echo "---> Able to connect to ${REMOTEHOST}:${REMOTEPORT} ..."
else
echo "---> Connection to ${REMOTEHOST}:${REMOTEPORT} failed. Reconnecting ..."
ssh -Nf -L 4873:stghouzz-nodejs:4873 $USERNAME@bastion.staging.houzz.net
fi