add variable

This commit is contained in:
Anton Romanov 2018-09-06 23:01:39 +04:00
parent cbcc006b13
commit 818c418565

View File

@ -2,7 +2,8 @@
USERSERVER="root@212.8.234.87" USERSERVER="root@212.8.234.87"
PROCESS_NAME="java -jar ng-tracker" ARTIFACT_NAME="ng-tracker"
PROCESS_NAME="java -jar $ARTIFACT_NAME"
PROCESS_RUNNING=`ssh -oStrictHostKeyChecking=no $USERSERVER "pgrep -f '$PROCESS_NAME' > /dev/null"` PROCESS_RUNNING=`ssh -oStrictHostKeyChecking=no $USERSERVER "pgrep -f '$PROCESS_NAME' > /dev/null"`
@ -15,8 +16,8 @@ fi
./gradlew assemble ./gradlew assemble
ssh $USERSERVER "cd /tmp && rm -rf ng-tracker*.jar && echo `date` 'killed' >> log_ng" ssh $USERSERVER "cd /tmp && rm -rf $ARTIFACT_NAME*.jar && echo `date` 'killed' >> log_$ARTIFACT_NAME"
scp build/libs/ng-tracker-0.1.0-SNAPSHOT.jar $USERSERVER:/tmp/ng-tracker-0.1.0-SNAPSHOT.jar scp build/libs/$ARTIFACT_NAME-0.1.0-SNAPSHOT.jar $USERSERVER:/tmp/$ARTIFACT_NAME-0.1.0-SNAPSHOT.jar
ssh $USERSERVER -f "cd /tmp/ && /opt/jdk1.8.0_144/bin/java -jar ng-tracker-0.1.0-SNAPSHOT.jar -Xms 512m -Xmx 1024m --server.port=8443 --server.http.port=8080 >> /home/user/logfile_ng" & ssh $USERSERVER -f "cd /tmp/ && /opt/jdk1.8.0_144/bin/java -jar $ARTIFACT_NAME-0.1.0-SNAPSHOT.jar -Xms 512m -Xmx 1024m --server.port=8443 --server.http.port=8080 >> /home/user/logfile_$ARTIFACT_NAME" &
sleep 10 sleep 10
echo "is deployed" echo "is deployed"