From 40757b2ac55ca8b1a209e6026fac8fe5cc081490 Mon Sep 17 00:00:00 2001 From: kaya <33685994+gayeon1025@users.noreply.github.com> Date: Mon, 15 Apr 2024 13:33:51 +0900 Subject: [PATCH] Create deploy.sh --- deploy.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..eb7ae3d --- /dev/null +++ b/deploy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +SERVER_HOME=$(pwd) +APPLICATION=devlog_springboot-0.0.1-SNAPSHOT.jar + +if [ -f $SERVER_HOME/application.pid ];then + kill -9 $(cat $SERVER_HOME/application.pid) + rm $SERVER_HOME/application.pid +fi + +sleep 1s + +nohup java -jar $APPLICATION >> spring.out 2>&1 & echo $! > application.pid