master
pan 4 years ago
commit 297276c5d6
  1. 1
      .gitignore
  2. 11
      Dockerfile
  3. 8
      shell/findPortPid
  4. 17
      shell/killNode
  5. 17
      shell/savePid
  6. 25
      shell/updateRisk

1
.gitignore vendored

@ -0,0 +1 @@
.idea

@ -0,0 +1,11 @@
FROM node:current-alpine3.12
RUN mkdir /app
COPY shell/* /app
WORKDIR /app
RUN git clone git@gogs.kirito.cool:panqihua/RiskCloudRun.git
WORKDIR /app/RiskCloudRun
CMD ["node","/bin/www"]

@ -0,0 +1,8 @@
#!/bin/sh
if [ $# == 1 ]
then
netstat -antp|grep $1|awk '{c=$7;split(c,d,"/");print match(d[1],/\d+/)?d[1]:-1}'
else
echo port param not found!
fi

@ -0,0 +1,17 @@
#!/bin/sh
if [ -e *.log ]
then
pid=`stat *.log|awk 'NR>1{next}{c=$0;gsub(/\D/,"",c);print c}'`
kill -9 $pid
if [ $? -eq 0 ]
then
echo "kill $pid success"
rm -f *.log
./run.sh
else
echo "kill $pid error"
fi
else
./run.sh
fi

@ -0,0 +1,17 @@
#!/bin/sh
echo "findPort $1"
while true
do
pid=`findPortPid $1`
if [ -z $pid ]
then
echo "pid not found!!!"
sleep 1s
else
echo "pid is $pid"
touch $pid.log && chmod +x $pid.log
break
fi
done

@ -0,0 +1,25 @@
#!/bin/sh
cd /app
export webclient='RiskCloudMock'
export webServer='RiskCloudFontend'
export PORT=2233
export webClient=https://risk.kirito.cool
export serverPort=5000
export listenAddress=0.0.0.0
export apiServer=https://risk.kirito.cool
function run(){
if [ ! -e $1 ]
then
git clone git@gogs.kirito.cool:panqihua/$1.git
fi
cd $1 && git reset --hard && git pull && yarn && chmod +x run.sh && killNode
}
run $webclient
run $webServer
Loading…
Cancel
Save