From 446a8c4580d458e6e7c4218618ec43703e0b7b82 Mon Sep 17 00:00:00 2001 From: kariskan Date: Thu, 22 Aug 2024 22:49:39 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=B0=B0=ED=8F=AC=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 19 +++++++++++++++++-- .../controller/MultipartFileController.java | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 89f4a08..915a679 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -46,6 +46,21 @@ jobs: run: | /usr/bin/ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF cd /home/ubuntu - kill $(lsof -t -i:8080) - nohup java -jar storage-0.0.1-SNAPSHOT.jar --spring.profiles.active=local > app.log 2>&1 & + PID=$(lsof -t -i:8080 || echo "") + if [ ! -z "$PID" ]; then + echo "Killing process on port 8080" + kill -9 $PID || echo "Failed to kill process" + else + echo "No process found on port 8080" + fi + sleep 5 + nohup java -jar app.jar --spring.profiles.active=local > app.log 2>&1 & + echo "Started new application" + sleep 10 + if lsof -i:8080; then + echo "Application is running on port 8080" + else + echo "Application failed to start on port 8080" + exit 1 + fi EOF diff --git a/src/main/java/com/woowacamp/storage/domain/file/controller/MultipartFileController.java b/src/main/java/com/woowacamp/storage/domain/file/controller/MultipartFileController.java index 0b385ed..7da37e2 100644 --- a/src/main/java/com/woowacamp/storage/domain/file/controller/MultipartFileController.java +++ b/src/main/java/com/woowacamp/storage/domain/file/controller/MultipartFileController.java @@ -346,7 +346,7 @@ ResponseEntity download(@PathVariable Long fileId, @GetMapping("/hi") public String a() { - return "hihi"; + return "bibi"; } }