-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
145 additions
and
8 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
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,56 @@ | ||
name: ShowPot-Prod-CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- prod | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'liberica' | ||
cache: gradle | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Copy Secrets | ||
env: | ||
ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} | ||
SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} | ||
run: | ||
echo $ACCESS_KEY > ./app/src/main/resources/application-prod.yml | ||
echo $SECRET_KEY > ./app/src/main/resources/application-prod.yml | ||
|
||
- name: Build with Gradle Wrapper | ||
run: ./gradlew clean build | ||
|
||
- name: Backend CI Discord Notification | ||
uses: sarisia/actions-status-discord@v1 | ||
if: success() | ||
with: | ||
title: ✅ Backend CI success ✅ | ||
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
content: "<@1084774841460215839> <@281597829636423682> ShoPot 이슈 혹은 PR을 확인해주세요!" | ||
color: 00FF00 | ||
username: showPot-Bot | ||
avatar_url: ${{ secrets.DISCORD_NOTIFICATION_SUCCESS_AVATAR_URL }} | ||
|
||
- name: Backend CI Discord Notification | ||
uses: sarisia/actions-status-discord@v1 | ||
if: failure() | ||
with: | ||
title: ❗️Backend CI failed ❗️ | ||
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
color: FF0000 | ||
username: showPot-Bot | ||
avatar_url: ${{ secrets.DISCORD_NOTIFICATION_FAILED_AVATAR_URL }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
spring: | ||
docker: | ||
compose: | ||
enabled: false | ||
enabled: false | ||
|
||
cloud: | ||
aws: | ||
credentials: | ||
accessKey: ${ACCESS_KEY} | ||
secretKey: ${SECRET_KEY} |
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,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
|
||
<conversionRule conversionWord="clr" | ||
converterClass="org.springframework.boot.logging.logback.ColorConverter"/> | ||
<conversionRule conversionWord="wex" | ||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> | ||
<conversionRule conversionWord="wEx" | ||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> | ||
|
||
<property name="CONSOLE_LOG_PATTERN" | ||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> | ||
|
||
<springProperty name="ACTIVE_PROFILE" source="spring.profiles.active"/> | ||
<springProperty name="AWS_ACCESS_KEY" source="cloud.aws.credentials.accessKey"/> | ||
<springProperty name="AWS_SECRET_KEY" source="cloud.aws.credentials.secretKey"/> | ||
|
||
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>${CONSOLE_LOG_PATTERN}</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<appender name="CloudWatchAppender" class="ca.pjer.logback.AwsLogsAppender"> | ||
<layout> | ||
<pattern>[%thread] [%date] [%level] [%file:%line] - %msg%n</pattern> | ||
</layout> | ||
<!-- Information of Cloudwatch --> | ||
<logGroupName>showpot/${ACTIVE_PROFILE}</logGroupName> | ||
<logRegion>ap-northeast-2</logRegion> | ||
<maxBatchLogEvents>50</maxBatchLogEvents> | ||
<maxFlushTimeMillis>60000</maxFlushTimeMillis> | ||
<maxBlockTimeMillis>5000</maxBlockTimeMillis> | ||
<retentionTimeDays>0</retentionTimeDays> | ||
<accessKeyId>${AWS_ACCESS_KEY}</accessKeyId> | ||
<secretAccessKey>${AWS_SECRET_KEY}</secretAccessKey> | ||
|
||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
<level>WARN</level> | ||
</filter> | ||
|
||
<encoder> | ||
<charset>UTF-8</charset> | ||
<pattern>%d{HH:mm:ss.SSS} [%thread] [%5level] %logger{35}[%method:%line] %m%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<springProfile name="local, dev, prod"> | ||
<root level="INFO"> | ||
<appender-ref ref="Console"/> | ||
</root> | ||
</springProfile> | ||
|
||
<springProfile name="dev, prod"> | ||
<root level="WARN"> | ||
<appender-ref ref="CloudWatchAppender"/> | ||
</root> | ||
</springProfile> | ||
</configuration> |