ng-tracker/deploy/gdccloud/deploy.sh

24 lines
879 B
Bash
Raw Permalink Normal View History

2018-09-06 22:50:34 +04:00
#!/bin/bash
2018-11-06 14:10:00 +04:00
USERSERVER="root@193.110.3.124"
2018-09-06 22:50:34 +04:00
2018-09-06 23:01:39 +04:00
ARTIFACT_NAME="ng-tracker"
PROCESS_NAME="java -jar $ARTIFACT_NAME"
2018-09-06 22:50:34 +04:00
PROCESS_RUNNING=`ssh -oStrictHostKeyChecking=no $USERSERVER "pgrep -f '$PROCESS_NAME' > /dev/null"`
if $PROCESS_RUNNING
then
ssh $USERSERVER "pkill -f '$PROCESS_NAME'"
else
echo "not running"
fi
./gradlew assemble
2018-09-06 23:01:39 +04:00
ssh $USERSERVER "cd /tmp && rm -rf $ARTIFACT_NAME*.jar && echo `date` 'killed' >> log_$ARTIFACT_NAME"
scp build/libs/$ARTIFACT_NAME-0.1.0-SNAPSHOT.jar $USERSERVER:/tmp/$ARTIFACT_NAME-0.1.0-SNAPSHOT.jar
2020-04-25 21:42:15 +04:00
ssh $USERSERVER -f "cd /tmp/ && /opt/jdk-11/bin/java -jar $ARTIFACT_NAME-0.1.0-SNAPSHOT.jar -Xms 512m -Xmx 1024m --server.port=8080 --server.http.port=8443 --ng-tracker.base-url=http://193.110.3.124:8080 --ng-tracker.dev-mode=false --ng-tracker.driver-path=/home/user >> /home/user/logfile_$ARTIFACT_NAME" &
2018-09-06 22:50:34 +04:00
sleep 10
2019-11-08 16:36:53 +04:00
echo "is deployed"