diff --git a/.github/workflows/backend-cd.yml b/.github/workflows/backend-cd.yml index 5bb4d60a..0b3349c3 100644 --- a/.github/workflows/backend-cd.yml +++ b/.github/workflows/backend-cd.yml @@ -9,7 +9,6 @@ on: jobs: backend-docker-build-and-push: - # πŸ”§ μž„μ‹œ: PR이 μ—΄λ¦¬κ±°λ‚˜ μ—…λ°μ΄νŠΈλ  λ•Œλ„ μ‹€ν–‰ if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' }} runs-on: ubuntu-latest @@ -76,7 +75,7 @@ jobs: backend-docker-pull-and-run: runs-on: [ self-hosted, prod ] needs: [ backend-docker-build-and-push ] - if: ${{ needs.backend-docker-build-and-push.result == 'success' && github.event.pull_request.merged == true }} + if: ${{ needs.backend-docker-build-and-push.result == 'success' && (github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true) }} steps: - name: ✨ Checkout repository diff --git a/build.gradle b/build.gradle index 762daa32..3bab1a27 100644 --- a/build.gradle +++ b/build.gradle @@ -29,23 +29,19 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-web' - runtimeOnly 'com.mysql:mysql-connector-j' + implementation 'org.springframework.boot:spring-boot-starter-actuator' + + //Test testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - implementation 'org.springframework.boot:spring-boot-starter-actuator' - // H2 Database + // Database runtimeOnly 'com.h2database:h2' + runtimeOnly 'org.postgresql:postgresql' // Swagger implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.11' - // Security - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'io.jsonwebtoken:jjwt-api:0.13.0' - runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0' - runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0' - // Lombok compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' @@ -60,6 +56,8 @@ dependencies { // Security implementation 'org.springframework.boot:spring-boot-starter-security' testImplementation "org.springframework.security:spring-security-test" + + // JWT implementation 'io.jsonwebtoken:jjwt-api:0.13.0' runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0' runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0' diff --git a/deploy.sh b/deploy.sh index 12dd1bbb..6e69a6d0 100644 --- a/deploy.sh +++ b/deploy.sh @@ -122,7 +122,7 @@ fi # νŠΈλž˜ν”½ μ „ν™˜ 확인 (Nginx κΈ°μ€€ ν—¬μŠ€μ²΄ν¬) echo "νŠΈλž˜ν”½ μ „ν™˜ 확인 쀑..." sleep 5 -NGINX_CHECK=$(curl -s --connect-timeout 5 http://127.0.0.1/api/health-check 2>/dev/null || echo "failed") +NGINX_CHECK=$(curl -s --connect-timeout 5 http://127.0.0.1/health-check 2>/dev/null || echo "failed") if echo "${NGINX_CHECK}" | grep -q "OK"; then echo "βœ… νŠΈλž˜ν”½μ΄ μ„±κ³΅μ μœΌλ‘œ μ „ν™˜λ˜μ—ˆμŠ΅λ‹ˆλ‹€." else diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index e960324e..e4e7d4ac 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,53 +1,53 @@ -# docker-compose.yml -version: '3.8' - -services: - blue: - image: minibrb/linkiving-core:latest - container_name: blue - environment: - - LANG=ko_KR.UTF-8 - - TZ=Asia/Seoul - ports: - - '8080:8080' - healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ] - interval: 30s - timeout: 10s - retries: 3 - start_period: 40s - restart: unless-stopped - networks: - - app-network - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "3" - - green: - image: minibrb/linkiving-core:latest - container_name: green - environment: - - LANG=ko_KR.UTF-8 - - TZ=Asia/Seoul - ports: - - '8081:8080' - healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ] - interval: 30s - timeout: 10s - retries: 3 - start_period: 40s - restart: unless-stopped - networks: - - app-network - logging: - driver: "json-file" - options: - max-size: "10m" - max-file: "3" - -networks: - app-network: - driver: bridge +# docker-compose.yml +version: '3.8' + +services: + blue: + image: linkivingsofa/core:latest + container_name: blue + environment: + - LANG=ko_KR.UTF-8 + - TZ=Asia/Seoul + ports: + - '8080:8080' + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + restart: unless-stopped + networks: + - app-network + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + + green: + image: linkivingsofa/core:latest + container_name: green + environment: + - LANG=ko_KR.UTF-8 + - TZ=Asia/Seoul + ports: + - '8081:8080' + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8080/health-check" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + restart: unless-stopped + networks: + - app-network + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + +networks: + app-network: + driver: bridge