-
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.
Feat: Implment CI Code For Deployment
- Loading branch information
Showing
6 changed files
with
114 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,31 @@ | ||
name: Make Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
IMAGE_TAG: latest | ||
|
||
defaults: | ||
run: | ||
working-directory: pnu-book-store-batch | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to NCP Registry | ||
id: login_registry | ||
run: | | ||
docker login ${{ secrets.REGISTRY }} --username ${{ secrets.ACCESS_TOKEN }} --password ${{ secrets.SECRET_TOKEN }} | ||
- name: Docker Build | ||
run: | | ||
docker build -t ${{ secrets.REGISTRY }}/${{secrets.REPOSITORY}}:$IMAGE_TAG . | ||
docker push ${{ secrets.REGISTRY }}/${{secrets.REPOSITORY}}:$IMAGE_TAG | ||
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,18 @@ | ||
# 1. build | ||
FROM gradle:7.5.1-jdk17 as build | ||
|
||
WORKDIR /home/gradle/project | ||
|
||
COPY . . | ||
|
||
RUN gradle wrapper | ||
RUN ./gradlew clean build -x test | ||
|
||
# 2. Run the application | ||
FROM eclipse-temurin:17-jdk-jammy | ||
|
||
WORKDIR /opt/batch | ||
|
||
COPY --from=build /home/gradle/project/build/libs/batch.jar . | ||
|
||
CMD ["java", "-Dspring.profiles.active=prod", "-jar", "batch.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
26 changes: 26 additions & 0 deletions
26
pnu-book-store-batch/src/main/resources/application-dev.yml
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,26 @@ | ||
spring: | ||
datasource: | ||
url: jdbc:mysql://localhost:3306/cloudteam18?use_ssl=false | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
username: root | ||
password: qwer1234 | ||
|
||
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
show-sql: true | ||
database-platform: org.hibernate.dialect.MySQLDialect | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
default_batch_fetch_size: 100 | ||
open-in-view: false | ||
|
||
application: | ||
name: PnuBookStoreBatchApplication | ||
|
||
batch: | ||
jdbc: | ||
initialize-schema: always | ||
job: | ||
enabled: false |
26 changes: 26 additions & 0 deletions
26
pnu-book-store-batch/src/main/resources/application-prod.yml
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,26 @@ | ||
spring: | ||
datasource: | ||
url: ${DATABASE_URI} | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
username: ${DATABASE_USERNAME} | ||
password: ${DATABASE_PASSWORD} | ||
|
||
jpa: | ||
hibernate: | ||
ddl-auto: none | ||
show-sql: false | ||
database-platform: org.hibernate.dialect.MySQLDialect | ||
properties: | ||
hibernate: | ||
format_sql: false | ||
default_batch_fetch_size: 100 | ||
open-in-view: false | ||
|
||
application: | ||
name: PnuBookStoreBatchApplication | ||
|
||
batch: | ||
jdbc: | ||
initialize-schema: always | ||
job: | ||
enabled: false |
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,26 +1,3 @@ | ||
spring: | ||
datasource: | ||
url: jdbc:mysql://localhost:3306/cloudteam18?use_ssl=false | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
username: root | ||
password: qwer1234 | ||
|
||
jpa: | ||
hibernate: | ||
ddl-auto: validate | ||
show-sql: true | ||
database-platform: org.hibernate.dialect.MySQLDialect | ||
properties: | ||
hibernate: | ||
format_sql: true | ||
default_batch_fetch_size: 100 | ||
open-in-view: false | ||
|
||
application: | ||
name: PnuBookStoreBatchApplication | ||
|
||
batch: | ||
jdbc: | ||
initialize-schema: always | ||
job: | ||
enabled: false | ||
profiles: | ||
active: dev |