Skip to content

Commit

Permalink
Merge pull request #8 from easy-lead/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
oU-Ua authored Jul 13, 2024
2 parents 3a4c722 + 2f7af10 commit 4a28331
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 18 deletions.
18 changes: 18 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/app/
overwrite: yes

permissions:
- object: /
pattern: "**"
owner: ubuntu
group: ubuntu

hooks:
ApplicationStart:
- location: deploy.sh
timeout: 60
runas: ubuntu
18 changes: 0 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,7 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('bootBuildImage') {
builder = 'paketobuildpacks/builder-jammy-base:latest'
}

tasks.named('test') {
useJUnitPlatform()
}
tasks.register('buildZip', Zip) {
from compileJava
from processResources
into('lib') {
from configurations.runtimeClasspath
}
}

bootJar {
archiveBaseName.set('easyLeadServer')
}

jar {
enabled = false
}
31 changes: 31 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

REPOSITORY=/home/ubuntu/app

echo "> 현재 구동 중인 애플리케이션 pid 확인"
PORT = $(8080)
CURRENT_PID=$(sudo lsof -t -i:$PORT)

echo "현재 구동 중인 애플리케이션 pid: $CURRENT_PID"

if [ -z "$CURRENT_PID" ]; then
echo "현재 구동 중인 애플리케이션이 없으므로 종료하지 않습니다."
else
echo "> kill -9 $CURRENT_PID"
kill -9 $CURRENT_PID
sleep 5
fi

echo "> 새 애플리케이션 배포"

JAR_NAME=$(ls -tr $REPOSITORY/*SNAPSHOT.jar | tail -n 1)

echo "> JAR NAME: $JAR_NAME"

echo "> $JAR_NAME 에 실행권한 추가"

chmod +x $JAR_NAME

echo "> $JAR_NAME 실행"

nohup java -jar -Duser.timezone=Asia/Seoul $JAR_NAME >> $REPOSITORY/nohup.out 2>&1 &

0 comments on commit 4a28331

Please sign in to comment.