Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ jobs:
- name: SSH로 EC2에 접속하기
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEVSYNC_EC2_HOST}}
username: ${{ secrets.DEVSYNC_EC2_USERNAME}}
key: ${{ secrets.DEVSYNC_EC2_PRIVATE_KEY}}
host: ${{ secrets.DEVSYNC_EC2_HOST }}
username: ${{ secrets.DEVSYNC_EC2_USERNAME }}
key: ${{ secrets.DEVSYNC_EC2_PRIVATE_KEY }}
script_stop: true
script: |
cd ~/devsync
docker compose down || true
echo "복사한 .env 파일을 준비합니다."
echo "RDS_ENDPOINT=${{ secrets.RDS_ENDPOINT }}" > .env
echo "RDS_USERNAME=${{ secrets.RDS_USERNAME }}" >> .env
echo "RDS_PASSWORD=${{ secrets.RDS_PASSWORD }}" >> .env
docker-compose down || true
docker pull ${{ secrets.DEVSYNC_ECR_REGISTRY }}/devsync:latest
docker compose up -d --build
docker-compose up -d --build
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM openjdk:17-jdk
COPY build/libs/devsync.jar devsync.jar
ENTRYPOINT ["java", "-jar", "devsync.jar"]
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ dependencies {
testImplementation 'org.assertj:assertj-core:3.24.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0'
// swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0'

// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
Expand All @@ -70,3 +70,9 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

bootJar {
archiveBaseName.set("devsync")
archiveVersion.set("")
archiveClassifier.set("")
}
37 changes: 18 additions & 19 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
spring.application.name=devsync

# Swagger
swagger.server.url=http://localhost:8080

# H2 Database ??
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.h2.console.enabled=true

# JWT Secret Key
spring.jwt.secret=nH3Hj8aTgFz1vB3LgKm2t4zWk9YqL1D6abcdefghiJklmnopQ=

# Redis
spring.data.redis.host=localhost
spring.data.redis.port=6379

#spring.application.name=devsync
#
## Swagger
#swagger.server.url=http://localhost:8080
#
## H2 Database ??
#spring.datasource.url=jdbc:h2:mem:testdb
#spring.datasource.driver-class-name=org.h2.Driver
#spring.datasource.username=sa
#spring.datasource.password=
#spring.h2.console.enabled=true
#
## JWT Secret Key
#spring.jwt.secret=nH3Hj8aTgFz1vB3LgKm2t4zWk9YqL1D6abcdefghiJklmnopQ=
#
## Redis
#spring.data.redis.host=localhost
#spring.data.redis.port=6379
52 changes: 52 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
spring:
application:
name: devsync
profiles:
active: # 기본 프로파일 설정

# 공통 설정
---
spring:
jpa:
show-sql: true
jwt:
secret: nH3Hj8aTgFz1vB3LgKm2t4zWk9YqL1D6abcdefghiJklmnopQ=

# 개발용 설정 (dev)
---
spring:
config.activate.on-profile: dev
datasource:
url: jdbc:h2:mem:testdb
username: sa
password:
driver-class-name: org.h2.Driver
h2:
console:
enabled: true
path: /h2-console
swagger:
server:
url: http://localhost:8080
data:
redis:
host: localhost
port: 6379
sql:
init:
mode:


# 배포용 설정 (prod)
---
spring:
config.activate.on-profile: prod
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${RDS_ENDPOINT}:3306/issuemap
username: ${RDS_USERNAME}
password: ${RDS_PASSWORD}
data:
redis:
host: localhost
port: 6379
Loading