diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..52276271 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @ImNM @sanbonai06 @cofls6581 @gengminy @kim-wonjin \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..47783df4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +## 개요 +- close #issueNumber + +## 작업사항 +- 내용을 적어주세요. + +## 변경로직 +- 내용을 적어주세요. \ No newline at end of file diff --git a/.github/workflows/BuildApiServer.yml b/.github/workflows/BuildApiServer.yml new file mode 100644 index 00000000..a670c253 --- /dev/null +++ b/.github/workflows/BuildApiServer.yml @@ -0,0 +1,53 @@ +name: Build Api Server +on: + push: + tags: + - Api-v*.*.* + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java-version: [ 17 ] + outputs: + version: ${{ steps.get_version.outputs.BRANCH_NAME }} + + steps: + - name: Check Out The Repository + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java-version }} + distribution: 'corretto' + + - name: Get the version + id: get_version + run: | + RELEASE_VERSION_WITHOUT_V="$(cut -d'v' -f2 <<< ${GITHUB_REF#refs/*/})" + echo ::set-output name=VERSION::$RELEASE_VERSION_WITHOUT_V + + - name: Gradle Build + uses: gradle/gradle-build-action@v2 + with: + arguments: | + build --no-daemon + build-root-directory: DuDung-Api + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: ./DuDung-Api + push: true + tags: water0641/dudung-api:${{ steps.get_version.outputs.VERSION }} + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..19ccf23e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: ci +on: + pull_request: + branch: 'dev' + +jobs: + spotlessJavaCheck: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: SetUp JDK 17 + uses: actions/setup-java@v2 + with: + java-version: "17" + distribution: 'adopt' + + - name: Gradle Caching + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Grant execute permission for gradlew + run: chmod +x ./gradlew + + - name: Run build + run: ./gradlew build -x test \ No newline at end of file diff --git a/DuDung-Api/Dockerfile b/DuDung-Api/Dockerfile new file mode 100644 index 00000000..5f30eb45 --- /dev/null +++ b/DuDung-Api/Dockerfile @@ -0,0 +1,9 @@ +FROM openjdk:17-alpine + +EXPOSE 8080 + +COPY ./build/libs/*.jar app.jar +ARG PROFILE=prod +ENV PROFILE=${PROFILE} + +ENTRYPOINT ["java","-Dspring.profiles.active=${PROFILE}", "-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] \ No newline at end of file diff --git a/DuDung-Infrastructure/build.gradle b/DuDung-Infrastructure/build.gradle index 47daba43..5d5beb13 100644 --- a/DuDung-Infrastructure/build.gradle +++ b/DuDung-Infrastructure/build.gradle @@ -1,3 +1,6 @@ +bootJar { enabled = false } +jar { enabled = true } + dependencies { implementation("com.slack.api:slack-api-client:1.27.2") implementation 'io.github.openfeign:feign-httpclient:12.1'