-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: CI 테스크 구현 * fix: 테스트에 구현 미반영 사항 반영 * feat: code-ci 액션 구현 * feat: 환경 변수 추가 * feat: info 로그 레벨 추가 * feat: 빌드시 테스트 제외 추가 * feat: stacktrace 로그 레밸 변경 * refactor: 기존 도커이미지 빌드 테스크 제거 * feat: jooqCodegen step 추가 * fix: 오타 수정 :api -> api * refactor: dockerBuildImage -> buildDockerImage로 테스크 수정 * feat: Docker Login 스텝 추가 * refactor: code-ci 트리거 조건 수정 pr -> push * feat: integration-test 액션 추가 * feat: docker-compose-api 추가 * fix: 공통으로 적용되던 build 설정 제거 * fix: Dockerfile java 버전 업 * refactor: docker-compose-api 노출 포트 수정 8081 -> 8080 * fix: @EnableWebMvc가 없어서 배포 이미지가 동작하지 않는 문제 해결 - todo: 로컬에서는 왜 없어도 동작하는지 확인 필요
- Loading branch information
1 parent
cbea94a
commit ffd4eb2
Showing
10 changed files
with
156 additions
and
25 deletions.
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,43 @@ | ||
name: CI Process | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
RELEASE_VERSION: ${{ github.sha }} | ||
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Jooq Code Generation | ||
run: | | ||
./gradlew --info jooqCodegen | ||
- name: Build with Gradle | ||
run: | | ||
./gradlew --info api:build | ||
- name: Test with Gradle | ||
run: | | ||
./gradlew --info test | ||
- name : Docker Login | ||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build Docker Image | ||
run: | | ||
./gradlew --info api:buildDockerImage |
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,35 @@ | ||
name: Integration Test | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Jooq Code Generation | ||
run: | | ||
./gradlew --info jooqCodegen | ||
- name: Build with Gradle | ||
run: | | ||
./gradlew --info api:build | ||
- name: Test with Gradle | ||
run: | | ||
./gradlew --info test |
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,17 @@ | ||
FROM openjdk:18-oracle | ||
|
||
RUN mkdir -p /logs | ||
|
||
ENV PROFILE default | ||
ENV TZ=Asia/Seoul | ||
EXPOSE 8080 | ||
|
||
ARG JAVA_OPTS | ||
|
||
ARG RELEASE_VERSION | ||
ENV DD_VERSION=${RELEASE_VERSION} | ||
|
||
ARG JAR_FILE="build/libs/api.jar" | ||
COPY ${JAR_FILE} app.jar | ||
|
||
ENTRYPOINT java -XX:MaxGCPauseMillis=100 -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=80.0 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 $JAVA_OPTS -jar app.jar |
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
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
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,14 @@ | ||
version: '3.1' | ||
services: | ||
api: | ||
container_name: api | ||
image: fewletter/api:latest | ||
ports: | ||
- "8080:8080" | ||
environment: | ||
SPRING_PROFILES_ACTIVE: ${API_SPRING_PROFILES_ACTIVE} | ||
DB_HOSTNAME: ${DB_HOSTNAME} | ||
DB_USERNAME: ${DB_USERNAME} | ||
DB_PASSWORD: ${DB_PASSWORD} | ||
EMAIL_USERNAME: ${EMAIL_USERNAME} | ||
EMAIL_PASSWORD: ${EMAIL_PASSWORD} |
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,6 @@ | ||
#!/bin/sh | ||
|
||
cd .. | ||
docker-compose -f docker-compose-api.yml down | ||
docker-compose -f docker-compose-api.yml up -d | ||
sleep 10 |