This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEAV-21] ✨ 개발서버 CI workflow 구현 (#9)
- Loading branch information
1 parent
241748a
commit b86df56
Showing
8 changed files
with
111 additions
and
4 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,39 @@ | ||
name: CI - Dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check Out Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Login to Amazon ECR Public | ||
id: login-ecr-public | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
registry-type: public | ||
|
||
- name: Build, tag, and push docker image to Amazon ECR Public | ||
env: | ||
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} | ||
REGISTRY_ALIAS: h3l4i6v1 | ||
REPOSITORY: weave_server_dev_cr | ||
IMAGE_TAG: ${{ github.sha }} | ||
run: | | ||
docker build -f Dockerfile-http -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG . | ||
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG | ||
- name: Logout of Amazon ECR | ||
run: docker logout ${{ env.ECR_REGISTRY }} |
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,11 @@ | ||
# Build stage | ||
FROM gradle:jdk17 AS build | ||
COPY --chown=gradle:gradle . /home/gradle/src | ||
WORKDIR /home/gradle/src | ||
RUN gradle :bootstrap:http:bootJar --no-daemon | ||
|
||
# Package stage | ||
FROM openjdk:17 | ||
COPY --from=build /home/gradle/src/bootstrap/http/build/libs/http-*.jar /app.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java","-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
version: '3.8' | ||
services: | ||
spring: | ||
image: public.ecr.aws/h3l4i6v1/weave_server_dev_cr | ||
environment: | ||
SPRING_PROFILES_ACTIVE: dev | ||
DB_URL: jdbc:mysql://mysql/weave?serverTimezone=Asia/Seoul&characterEncoding=UTF-8&allowPublicKeyRetrieval=true | ||
DB_USERNAME: root | ||
DB_PASSWORD: secret | ||
depends_on: | ||
- mysql | ||
mysql: | ||
image: mysql:8.0.33 | ||
environment: | ||
- "MYSQL_DATABASE=user" | ||
- "MYSQL_ROOT_PASSWORD=secret" | ||
MYSQL_DATABASE: weave | ||
MYSQL_ROOT_PASSWORD: secret | ||
ports: | ||
- "3306:3306" |
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,9 @@ | ||
version: '3.8' | ||
services: | ||
mysql: | ||
image: mysql:8.0.33 | ||
environment: | ||
MYSQL_DATABASE: weave | ||
MYSQL_ROOT_PASSWORD: secret | ||
ports: | ||
- "3306:3306" |
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
32 changes: 32 additions & 0 deletions
32
infrastructure/persistence/src/main/resources/application-persistence.yaml
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,32 @@ | ||
spring: | ||
datasource: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
url: ${DB_URL:jdbc:mysql://localhost:3306/weave?serverTimezone=Asia/Seoul&characterEncoding=UTF-8} | ||
username: ${DB_USERNAME:root} | ||
password: ${DB_PASSWORD:secret} | ||
jpa: | ||
open-in-view: false | ||
hibernate: | ||
naming: | ||
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl | ||
properties: | ||
hibernate.format_sql: true | ||
dialect: org.hibernate.dialect.MySQL8InnoDBDialect | ||
--- | ||
spring: | ||
config: | ||
activate: | ||
on-profile: local | ||
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
show-sql: true | ||
--- | ||
spring: | ||
config: | ||
activate: | ||
on-profile: dev | ||
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
show-sql: true |