diff --git a/.github/workflows/ci-batch.yaml b/.github/workflows/ci-batch.yaml deleted file mode 100644 index 9c7dba9..0000000 --- a/.github/workflows/ci-batch.yaml +++ /dev/null @@ -1,46 +0,0 @@ -#name: ci-batch -# -#on: -# workflow_dispatch: -# inputs: -# job_name: -# required: true -# type: string -# description: 실행할 job 명칭 input -# -#jobs: -# ci-batch: -# runs-on: ubuntu-latest -# steps: -# - name: Git Checkout -# uses: actions/checkout@v2 -# -# - name: Setup JDK -# uses: actions/setup-java@v1 -# with: -# java-version: 17 -# -# - name: Grant execute permission for gradlew -# run: chmod +x gradlew -# -# - name: Build Gradle -# run: -# -# - name: Dockerhub Login -# uses: docker/login-action@v2 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - name: Build Gradle with JIB (API) -# run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts --Dspring.profiles.active=prod --job.name=${{ github.event.inputs.job_name }} build -# -## - name: Execute Remote SSH & Deploy 'API' module -## uses: appleboy/ssh-action@master -## with: -## host: ${{ secrets.REMOTE_SSH_HOST }} -## username: ${{ secrets.REMOTE_SSH_USERNAME }} -## key: ${{ secrets.REMOTE_SSH_KEY }} -## script: | -## docker pull johnpark0921/lotto-portfolio -## docker container run --name lotto-portfolio -p 8080:8080 johnpark0921/lotto-portfolio \ No newline at end of file diff --git a/.github/workflows/drwtStore-batch.yaml b/.github/workflows/drwtStore-batch.yaml new file mode 100644 index 0000000..3f91095 --- /dev/null +++ b/.github/workflows/drwtStore-batch.yaml @@ -0,0 +1,26 @@ +name: drwtStore-batch + +on: + schedule: + - cron: '0 21 * * SUN' # 매주 일요일 21시 + +jobs: + drwtStore-batch: + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Setup JDK + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Gradle + run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts build + + - name: Job Execute + run: java -jar --Dspring.profiles.active=prod --job.name=lottoDrwtStoreJob ./build/libs/batch-0.0.1-SNAPSHOT.jar diff --git a/.github/workflows/number-batch.yaml b/.github/workflows/number-batch.yaml new file mode 100644 index 0000000..d6aec35 --- /dev/null +++ b/.github/workflows/number-batch.yaml @@ -0,0 +1,39 @@ +name: number-batch + +on: + workflow_dispatch: + inputs: + startDrwtNo: + description: 시작회차 + default: "" + type: string + endDrwtNo: + description: 종료회차 + default: "" + type: string + schedule: + - cron: '0 21 * * SUN' # 매주 일요일 21시 + +jobs: + number-batch: + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Setup JDK + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Gradle + run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts build + + - name: Job Execute + run: java -jar --Dspring.profiles.active=prod --job.name=lottoNumberJob startDrwtNo=$START_DRWTNO endDrwtNo=$END_DRWTNO ./build/libs/batch-0.0.1-SNAPSHOT.jar + env: + START_DRWTNO: ${{ inputs.startDrwtNo }} + END_DRWTNO: ${{ inputs.endDrwtNo }} diff --git a/.github/workflows/store-batch.yaml b/.github/workflows/store-batch.yaml new file mode 100644 index 0000000..fba490a --- /dev/null +++ b/.github/workflows/store-batch.yaml @@ -0,0 +1,26 @@ +name: store-batch + +on: + schedule: + - cron: '0 21 1 */6 *' # 6개월마다 1일 21시 (1/1, 7/1) + +jobs: + store-batch: + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Setup JDK + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build Gradle + run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts build + + - name: Job Execute + run: java -jar --Dspring.profiles.active=prod --job.name=lottoStoreJob ./build/libs/batch-0.0.1-SNAPSHOT.jar diff --git a/batch/src/main/resources/application-batch.yaml b/batch/src/main/resources/application-batch.yaml index 536684f..8908ba2 100644 --- a/batch/src/main/resources/application-batch.yaml +++ b/batch/src/main/resources/application-batch.yaml @@ -8,5 +8,5 @@ spring: client: config: default: - connect-timeout: 3000 - read-timeout: 3000 + connect-timeout: 10000 + read-timeout: 10000 diff --git a/core/src/main/resources/application-core-prod.yaml b/core/src/main/resources/application-core-prod.yaml index 9a4c895..80a3931 100644 --- a/core/src/main/resources/application-core-prod.yaml +++ b/core/src/main/resources/application-core-prod.yaml @@ -9,7 +9,7 @@ spring: generate-ddl: true datasource: hikari: - connection-timeout: 20000 + connection-timeout: 10000 minimum-idle: 10 maximum-pool-size: 100