-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CHORE] DEV_CD 파이프라인 구축 + application-dev.yml 작성 #58
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
0683e11
feat: application-dev.yml 작성
coli-geonwoo 300bdb7
chore: 변수명 변경
coli-geonwoo e52221a
chore: Dev_CD.yml 스크립트 작성
coli-geonwoo 7e1214d
chore: gradlew 권한 허용 추가
coli-geonwoo 726a6ab
chore: jar 파일 경로 수정
coli-geonwoo eed7381
chore: root 명령어로 pid 추출
coli-geonwoo e335d5b
chore: root 명령어로 kill 명령어 호출
coli-geonwoo 6d04069
chore: datasource 오타 수정
coli-geonwoo 30a84d8
chore: ddl-auto 설정 변경
coli-geonwoo e0c7226
chore: ddl-auto 설정 변경
coli-geonwoo c376434
chore: application-local.yml 설정 변경
coli-geonwoo 5c1f881
chore: actuator 추가
coli-geonwoo 59c1678
chore: checkout branch 변경
coli-geonwoo 17f9488
chore: 환경변수를 주입하도록 변경
coli-geonwoo 7d64b83
chore: 환경변수를 주입하도록 변경
coli-geonwoo 234840c
chore: pid 를 출력하도록 변경
coli-geonwoo 46ae1fc
chore: kill process 수정
coli-geonwoo 21b912a
chore: kill process 수정
coli-geonwoo 9f2727a
chore: kill process 수정
coli-geonwoo 070b61a
chore: 스크립트 분리
coli-geonwoo a4a6a87
chore: 스크립트 분리
coli-geonwoo 14cf8b7
chore: dev-secret.yml
coli-geonwoo ad80796
refactor: actuator 제거 및 트리거 복구
coli-geonwoo 2450fd2
style: 불필요한 개행 삭제
coli-geonwoo 9bc50d3
feat: 배포 파이프라인에 테스트 작업 추가
coli-geonwoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: dev-cd | ||
|
||
on: | ||
push: | ||
branches: | ||
- "develop" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Develop Branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "develop" | ||
|
||
- name: Setting dev-secret.yml | ||
run: | | ||
echo "${{ secrets.DEV_SECRET_YML }}" > ./src/main/resources/dev-secret.yml | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Make gradlew executable | ||
run: chmod +x gradlew | ||
|
||
- name: Clean And Test With Gradle | ||
run: ./gradlew clean test | ||
|
||
- name: bootJar with Gradle | ||
run: ./gradlew bootJar --info | ||
|
||
- name: Change artifact file name | ||
run: mv build/libs/*.jar build/libs/app.jar | ||
|
||
- name: Upload artifact file | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: app-artifact | ||
path: ./build/libs/app.jar | ||
if-no-files-found: error | ||
|
||
- name: Upload deploy scripts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: deploy-scripts | ||
path: ./scripts/dev/ | ||
if-no-files-found: error | ||
|
||
deploy: | ||
needs: build | ||
runs-on: dev | ||
|
||
steps: | ||
- name: Download artifact file | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: app-artifact | ||
path: ~/app | ||
|
||
- name: Download deploy scripts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: deploy-scripts | ||
path: ~/app/scripts | ||
|
||
- name: Replace application to latest | ||
run: sudo sh ~/app/scripts/replace-new-version.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
PID=$(lsof -t -i:8080) | ||
|
||
# 프로세스 종료 | ||
if [ -z "$PID" ]; then | ||
echo "No process is using port 8080." | ||
else | ||
echo "Killing process with PID: $PID" | ||
kill -15 "$PID" | ||
|
||
# 직전 명령(프로세스 종료 명령)이 정상 동작했는지 확인 | ||
if [ $? -eq 0 ]; then | ||
echo "Process $PID terminated successfully." | ||
else | ||
echo "Failed to terminate process $PID." | ||
fi | ||
fi | ||
|
||
JAR_FILE=$(ls /home/ubuntu/app/*.jar | head -n 1) | ||
|
||
sudo nohup java -Dspring.profiles.active=dev -Duser.timezone=Asia/Seoul -Dserver.port=8080 -jar "$JAR_FILE" & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
spring: | ||
config: | ||
import: dev-secret.yml | ||
datasource: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
url: jdbc:mysql://${secret.datasource.url}:${secret.datasource.port}/${secret.datasource.database}?useUnicode=true&characterEncoding=utf8&allowPublicKeyRetrieval=true&autoReconnect=true&serverTimezone=Asia/Seoul&useLegacyDatetimeCode=false | ||
username: ${secret.datasource.username} | ||
password: ${secret.datasource.password} | ||
jpa: | ||
show-sql: true | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
hibernate: | ||
ddl-auto: update | ||
defer-datasource-initialization: true |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트를 수행하지 않고 바로 배포하네요. 테스트를 수행하지 않아도 괜찮다고 판단한 이유가 궁금해요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영하였습니다.