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"; } }