-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #310 from Kernel360/develop
Main 브랜치 최신화 (24.03.18) (2)
- Loading branch information
Showing
20 changed files
with
108 additions
and
14 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 |
---|---|---|
|
@@ -23,7 +23,7 @@ jobs: | |
|
||
- name: Replace SQL Queries | ||
run: | | ||
dir_path="./module-api/src/main/resources/db/migration" | ||
dir_path="./module-domain/src/main/resources/db/migration" | ||
old_text="changeRequired" | ||
new_text="${{ secrets.PUBLIC_KEY }}" | ||
find "$dir_path" -type f -name "*.sql" -exec sed -i "s|$old_text|$new_text|g" {} + | ||
|
@@ -83,23 +83,36 @@ jobs: | |
chmod +x ./gradlew | ||
./gradlew bootJar | ||
- name: DockerHub Login | ||
uses: docker/login-action@v2 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ap-northeast-2 | ||
|
||
- name: Docker Image Build And Push (api) | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Build, tag, and push docker image to Amazon ECR (api) | ||
working-directory: ./module-api | ||
env: | ||
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
REPOSITORY: dev-washfit-api | ||
IMAGE_TAG: latest | ||
run: | | ||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.MODULE_API_NAME }} . --platform=linux/amd64 | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.MODULE_API_NAME }} | ||
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . | ||
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG | ||
- name: Docker Image Build And Push (batch) | ||
- name: Build, tag, and push docker image to Amazon ECR (batch) | ||
working-directory: ./module-batch | ||
env: | ||
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
REPOSITORY: dev-washfit-batch | ||
IMAGE_TAG: latest | ||
run: | | ||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.MODULE_BATCH_NAME }} . --platform=linux/amd64 | ||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.MODULE_BATCH_NAME }} | ||
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . | ||
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG | ||
- name: Application Run | ||
uses: appleboy/[email protected] | ||
|
@@ -123,7 +136,7 @@ jobs: | |
echo "${{ secrets.DEV_REDIS_CONF }}" > ./redis/redis.conf | ||
echo "${{ secrets.DOCKER_COMPOSE }}" > docker-compose.yml | ||
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin ${{ steps.login-ecr.outputs.registry }} | ||
docker image prune -af | ||
|
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 |
---|---|---|
|
@@ -23,7 +23,7 @@ jobs: | |
|
||
- name: Replace SQL Queries | ||
run: | | ||
dir_path="./module-api/src/main/resources/db/migration" | ||
dir_path="./module-domain/src/main/resources/db/migration" | ||
old_text="changeRequired" | ||
new_text="${{ secrets.PUBLIC_KEY }}" | ||
find "$dir_path" -type f -name "*.sql" -exec sed -i "s|$old_text|$new_text|g" {} + | ||
|
@@ -35,6 +35,13 @@ jobs: | |
env: | ||
spring.profiles.active: "prod" | ||
|
||
- name: Set application yml file (batch) | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: ./module-batch/src/main/resources/application.yml | ||
env: | ||
spring.profiles.active: "prod" | ||
|
||
- name: Set application-prod yml file (api) | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
|
@@ -53,12 +60,29 @@ jobs: | |
aws.s3.bucket.name: ${{ secrets.AWS_S3_BUCKET_NAME }} | ||
aws.s3.bucket.url: ${{ secrets.AWS_S3_BUCKET_URL }} | ||
|
||
- name: Set application-dev yml file (batch) | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: ./module-batch/src/main/resources/application-prod.yml | ||
env: | ||
spring.datasource.url: ${{ secrets.DB_URL_AWS }} | ||
spring.datasource.username: ${{ secrets.DB_USER }} | ||
spring.datasource.password: ${{ secrets.DB_PW }} | ||
external.ecolife-api.path: ${{ secrets.ECOLIFE_PATH }} | ||
external.ecolife-api.service-key: ${{ secrets.ECOLIFE_KEY }} | ||
|
||
- name: Grant execute permission And Build with Gradle (api) | ||
working-directory: ./module-api | ||
run: | | ||
chmod +x ./gradlew | ||
./gradlew bootJar | ||
- name: Grant execute permission And Build with Gradle (batch) | ||
working-directory: ./module-batch | ||
run: | | ||
chmod +x ./gradlew | ||
./gradlew bootJar | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
|
@@ -70,7 +94,7 @@ jobs: | |
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Build, tag, and push docker image to Amazon ECR | ||
- name: Build, tag, and push docker image to Amazon ECR (api) | ||
working-directory: ./module-api | ||
env: | ||
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
|
@@ -80,6 +104,16 @@ jobs: | |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . | ||
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG | ||
- name: Build, tag, and push docker image to Amazon ECR (batch) | ||
working-directory: ./module-batch | ||
env: | ||
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
REPOSITORY: washfit-batch | ||
IMAGE_TAG: latest | ||
run: | | ||
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . | ||
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG | ||
- name: Application Run | ||
uses: appleboy/[email protected] | ||
with: | ||
|
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,47 @@ | ||
spring: | ||
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
show-sql: true | ||
properties: | ||
hibernate: | ||
generate_statistics: true | ||
jdbc: | ||
batch_size: 100 | ||
format_sql: true | ||
open-in-view: true | ||
|
||
datasource: | ||
driver-class-name: org.postgresql.Driver | ||
url: ${DB_URL_AWS} | ||
username: ${DB_USER} | ||
password: ${DB_PW} | ||
hikari: | ||
maximum-pool-size: 100 | ||
idle-timeout: 20000 | ||
validation-timeout: 5000 | ||
minimum-idle: 5 | ||
|
||
external: | ||
ecolife-api: | ||
path: ${ECOLIFE_PATH} | ||
service-key: ${ECOLIFE_KEY} | ||
|
||
|
||
logging: | ||
file: | ||
path: ./logs/batch/ | ||
name: batch-log | ||
logback: | ||
rolling policy: | ||
max-history: 14 | ||
max-file-size: 50MB | ||
total-size-cap: 5GB | ||
level: | ||
root: warn | ||
com.kernel360: debug | ||
org.hibernate.sql: debug | ||
org.hibernate.type.descriptor.sql: trace | ||
org: | ||
springframework: | ||
transaction=DEBUG: |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.