Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop-be' into feature/677
Browse files Browse the repository at this point in the history
# Conflicts:
#	backend/ddang/src/main/resources/static/docs/docs.html
  • Loading branch information
swonny committed Nov 3, 2023
2 parents 7102287 + f868d3a commit fb80954
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 80 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/backend_flyway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: flyway 스크립트 검증

on:
pull_request:
paths:
- 'backend/ddang/src/main/resources/db/migration/**.sql'
types: [opened, reopened, synchronize]
branches: [develop-be]

permissions: write-all
jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'backend')
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testdb
MYSQL_USER: test
MYSQL_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v3

- name: settings java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: cache gradle
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: chmod gradle
run: chmod +x backend/ddang/gradlew

- name: Wait for MySQL to be ready
run: |
while [ -z "$DATABASE_URL" ]; do
echo "Waiting for MySQL to be ready..."
export DATABASE_URL=$(echo "SELECT 'ready';" | mysql -h127.0.0.1 -P3306 -utest -ppassword testdb --skip-column-names 2>/dev/null)
sleep 1
done
- name: Create flyway.conf
run: |
touch flyway.conf
echo "flyway.driver=com.mysql.cj.jdbc.Driver" >> flyway.conf
echo "flyway.url=jdbc:mysql://127.0.0.1:3306/testdb" >> flyway.conf
echo "flyway.user=test" >> flyway.conf
echo "flyway.password=password" >> flyway.conf
echo "flyway.encoding=UTF-8" >> flyway.conf
echo "flyway.locations=filesystem:src/main/resources/db/migration" >> flyway.conf
echo "flyway.validateOnMigrate=true" >> flyway.conf
working-directory: ./backend/ddang

- name: flywayValidate
run: |
./gradlew -Dflyway.configFiles=flyway.conf flywayMigrate --stacktrace
working-directory: ./backend/ddang
30 changes: 3 additions & 27 deletions .github/workflows/backend_pr_decorator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,6 @@ jobs:
echo "AUTHOR_NAME=${AUTHOR_NAME}" >> $GITHUB_OUTPUT
echo "AUTHOR_ID=${AUTHOR_ID}" >> $GITHUB_OUTPUT
- name: set variables
id: variables
run: |
REVIEWERS_GIT_ID='${{ toJson(github.event.pull_request.requested_reviewers[*].login) }}'
reviewers=$(echo "$REVIEWERS_GIT_ID" | jq -r '.[]')
REVIEWERS_SLACK_ID=""
for reviewer in $reviewers; do
echo "Reviewer: $reviewer"
if [ "$reviewer" == "apptie" ]; then
REVIEWERS_SLACK_ID+="<@${{ secrets.apptie_slack_id }}> "
elif [ "$reviewer" == "swonny" ]; then
REVIEWERS_SLACK_ID+="<@${{ secrets.swonny_slack_id }}> "
elif [ "$reviewer" == "JJ503" ]; then
REVIEWERS_SLACK_ID+="<@${{ secrets.JJ503_slack_id }}> "
elif [ "$reviewer" == "kwonyj1022" ]; then
REVIEWERS_SLACK_ID+="<@${{ secrets.kwonyj1022_slack_id }}> "
fi
done
echo "AUTHOR=${AUTHOR}" >> $GITHUB_OUTPUT
echo "REVIEWERS=${REVIEWERS}" >> $GITHUB_OUTPUT
echo "REVIEWERS_SLACK_ID=${REVIEWERS_SLACK_ID}" >> $GITHUB_OUTPUT
- name: slack notification
if: github.event_name == 'pull_request' && github.event.action != 'synchronize'
run: |
Expand All @@ -97,8 +72,7 @@ jobs:
SLACK_MESSAGE+="${{ github.event.pull_request.title }}"
SLACK_MESSAGE+="\n>\n>분석 결과\n>"
SLACK_MESSAGE+=":white_check_mark:"
SLACK_MESSAGE+="\n>\n>*리뷰어*\n>"
SLACK_MESSAGE+="${{ steps.variables.outputs.REVIEWERS_SLACK_ID }}"
SLACK_MESSAGE+="\n\n리뷰 요청은 스레드로 직접 멘션해주세요."
SLACK_MESSAGE+='"}}]}'
curl -X POST ${{ secrets.SLACK_WEBHOOK }} -d "${SLACK_MESSAGE}"
Expand All @@ -116,6 +90,7 @@ jobs:
SLACK_MESSAGE+="${{ github.event.pull_request.title }}"
SLACK_MESSAGE+="\n>\n>분석 결과\n>"
SLACK_MESSAGE+=":x:"
SLACK_MESSAGE+="\n\n리뷰 요청은 문제 해결 후 스레드로 직접 멘션해주세요."
SLACK_MESSAGE+='"}}]}'
curl -X POST ${{ secrets.SLACK_WEBHOOK }} -d "${SLACK_MESSAGE}"
Expand All @@ -133,6 +108,7 @@ jobs:
SLACK_MESSAGE+="${{ github.event.pull_request.title }}"
SLACK_MESSAGE+="\n>\n>분석 결과\n>"
SLACK_MESSAGE+=":black_square_for_stop:"
SLACK_MESSAGE+="\n\n리뷰 요청은 문제 해결 후 스레드로 직접 멘션해주세요."
SLACK_MESSAGE+='"}}]}'
curl -X POST ${{ secrets.SLACK_WEBHOOK }} -d "${SLACK_MESSAGE}"
10 changes: 10 additions & 0 deletions backend/ddang/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.flywaydb:flyway-mysql:9.16.0'
}
}

plugins {
id 'java'
id 'org.springframework.boot' version '3.0.8'
id 'io.spring.dependency-management' version '1.1.0'
id 'jacoco'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'org.flywaydb.flyway' version '9.16.0'
}

configurations {
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions backend/ddang/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ data:
init:
region:
enabled: false
auction:
enabled: false
user:
enabled: false

image:
store:
Expand Down

0 comments on commit fb80954

Please sign in to comment.