Skip to content

Commit aa0c298

Browse files
authored
[Merge] merge dev into main (#660)
2 parents 9ff3844 + da7fe73 commit aa0c298

1,133 files changed

Lines changed: 38376 additions & 30752 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
# [encoding-utf8]
6+
charset = utf-8
7+
8+
# [newline-lf]
9+
end_of_line = lf
10+
11+
# [newline-eof]
12+
insert_final_newline = true
13+
14+
[*.bat]
15+
end_of_line = crlf
16+
17+
[*.java]
18+
# [indentation-tab]
19+
indent_style = tab
20+
21+
# [4-spaces-tab]
22+
indent_size = 4
23+
tab_width = 4
24+
25+
# [no-trailing-spaces]
26+
trim_trailing_whitespace = true
27+
28+
[line-length-120]
29+
max_line_length = 120

.gitattributes

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Set the default behavior, in case people don't have core.autocrlf set.
2-
* text=auto
2+
* text=auto eol=lf
33

44
# Explicitly declare text files you want to always be normalized and converted
55
# to native line endings on checkout.
6-
*.java text=auto
7-
*.sql text=auto
8-
*.md text=auto
9-
*.txt text=auto
10-
*.gradle text=auto
11-
Dockerfile text=auto
12-
*.yml text=auto
13-
*.yaml text=auto
14-
*.sh text=auto
15-
6+
*.java text=auto eol=lf
7+
*.sql text=auto eol=lf
8+
*.md text=auto eol=lf
9+
*.txt text=auto eol=lf
10+
*.gradle text=auto eol=lf
11+
Dockerfile text=auto eol=lf
12+
*.yml text=auto eol=lf
13+
*.yaml text=auto eol=lf
14+
*.sh text=auto eol=lf
15+
*.bat text=auto eol=crlf
1616
# Denote all files that are truly binary and should not be modified.
1717
*.png binary
18-
*.jpg binary
18+
*.jpg binary
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 👮Checkstyle validation
2+
3+
on:
4+
pull_request:
5+
branches: [ main, dev ]
6+
7+
jobs:
8+
checkstyle:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 11
16+
- name: Grant execute permission for gradlew
17+
run: chmod +x gradlew
18+
- name: Main checkstyle
19+
run: ./gradlew --console verbose clean checkstyleMain
20+
- name: ️Test checkstyle
21+
run: ./gradlew --console verbose clean checkstyleTest

.github/workflows/main-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
DOCKER_USER: ${{ secrets.DOCKER_USER }}
1515
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1616
IMAGE_NAME: wken5577/42gg-server
17-
VERSION_TAG : ${{ secrets.VERSION_TAG }}
17+
VERSION_TAG: ${{ secrets.VERSION_TAG }}
1818

1919
permissions:
2020
contents: read
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Make application ymls
3838
run: |
39-
cd ./src/main/resources
39+
cd ./gg-pingpong-api/src/main/resources
4040
echo "${{ secrets.APPLICATION_YML }}" | base64 -d > application.yml
4141
shell: bash
4242

.github/workflows/test-code-validation.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,35 @@ jobs:
1515
java-version: 11
1616
- name: Grant execute permission for gradlew
1717
run: chmod +x gradlew
18+
1819
- name: ️👶 Unit Test with Gradle
19-
run: ./gradlew --console verbose clean unitTestCoverage
20-
- name: mv for separate report folder
21-
run: mv ./build/reports/jacoco/test ./build/reports/jacoco/unitTest
22-
- name: mv for separate report name
23-
run: mv ./build/reports/jacoco/unitTest/jacocoTestReport.xml ./build/reports/jacoco/unitTest/unitTestReport.xml
20+
run: ./gradlew --console verbose clean unitTestCoverage unitTestCoverageReport -x test
21+
22+
# - name: mv for separate report folder
23+
# run: mv ./gg-pingpong-utils/build/reports/jacoco/unitTestCoverageReport ./build/reports/jacoco/unitTest
24+
25+
# - name: mv for separate report name
26+
# run: mv ./build/reports/jacoco/unitTest/jacocoTestReport.xml ./build/reports/jacoco/unitTest/unitTestReport.xml
27+
2428
- name: 📲 Upload unitTest coverage to Codecov
25-
uses: codecov/codecov-action@v2
29+
uses: codecov/codecov-action@v3
2630
with:
2731
token: ${{ secrets.CODECOV_TOKEN }}
2832
fail_ci_if_error: true
29-
files: ./build/reports/jacoco/unitTest/unitTestReport.xml
33+
files: ./gg-utils/build/reports/jacoco/unitTestCoverageReport/unitTestCoverageReport.xml
3034
flags: unitTest
3135
name: codecov-unit
3236
verbose: true
37+
3338
- name: 👨‍👨‍👧‍👦 Integration Test with Gradle
34-
run: ./gradlew --console verbose clean integrationTestCoverage
39+
run: ./gradlew --console verbose clean integrationTestCoverage integrationTestCoverageReport -x test
40+
3541
- name: 📲 Upload integrationTest coverage to Codecov
36-
uses: codecov/codecov-action@v2
42+
uses: codecov/codecov-action@v3
3743
with:
3844
token: ${{ secrets.CODECOV_TOKEN }}
3945
fail_ci_if_error: true
40-
files: ./build/reports/jacoco/test/jacocoTestReport.xml
46+
files: ./gg-utils/build/reports/jacoco/integrationTestCoverageReport/integrationTestCoverageReport.xml
4147
flags: integrationTest
4248
name: codecov-integration
4349
verbose: true

.github/workflows/test-deploy.yml

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
DOCKER_USER: ${{ secrets.DOCKER_USER }}
1717
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
1818
IMAGE_NAME: wken5577/test-migrate-server
19-
19+
2020
permissions:
2121
contents: read
2222

@@ -26,63 +26,66 @@ jobs:
2626
runs-on: ubuntu-latest
2727

2828
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v3
31-
32-
- name: Set up JDK 11
33-
uses: actions/setup-java@v3
34-
with:
35-
java-version: '11'
36-
distribution: 'temurin'
37-
38-
- name: Make application ymls
39-
run: |
40-
cd ./src/main/resources
41-
echo "${{ secrets.MIGRATE_APPLICATION_YML }}" | base64 -d > application.yml
42-
shell: bash
43-
44-
- name: Login to Docker Hub
45-
uses: docker/login-action@v1
46-
with:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Set up JDK 11
33+
uses: actions/setup-java@v3
34+
with:
35+
java-version: '11'
36+
distribution: 'temurin'
37+
38+
- name: Make application ymls
39+
run: |
40+
cd ./gg-pingpong-api/src/main/resources
41+
echo "${{ secrets.MIGRATE_APPLICATION_YML }}" | base64 -d > application.yml
42+
shell: bash
43+
44+
- name: Login to Docker Hub
45+
uses: docker/login-action@v1
46+
with:
4747
username: ${{ env.DOCKER_USER }}
4848
password: ${{ env.DOCKER_PASSWORD }}
49-
50-
- name: Build with Gradle
51-
run: ./gradlew clean test build
52-
53-
- name: build new docker image as latest tag
54-
run: |
55-
docker build -t ${{ env.IMAGE_NAME }}:latest .
56-
docker push ${{ env.IMAGE_NAME }}:latest
57-
58-
- name: Get Github Actions IP
59-
id: ip
60-
uses: haythem/public-ip@v1.3
61-
62-
- name: AWS Credentials
63-
uses: aws-actions/configure-aws-credentials@v2
64-
with:
65-
aws-access-key-id: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_ACCESS_KEY_ID }}
66-
aws-secret-access-key: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_SECRET_KEY }}
67-
aws-region: ap-northeast-2
68-
69-
- name: Add Github Actions IP to Security group
70-
run: |
49+
50+
- name: Test with Gradle
51+
run: ./gradlew clean test
52+
53+
- name: Build with Gradle
54+
run: ./gradlew clean build -x test
55+
56+
- name: build new docker image as latest tag
57+
run: |
58+
docker build -t ${{ env.IMAGE_NAME }}:latest .
59+
docker push ${{ env.IMAGE_NAME }}:latest
60+
61+
- name: Get Github Actions IP
62+
id: ip
63+
uses: haythem/public-ip@v1.3
64+
65+
- name: AWS Credentials
66+
uses: aws-actions/configure-aws-credentials@v2
67+
with:
68+
aws-access-key-id: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_ACCESS_KEY_ID }}
69+
aws-secret-access-key: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_SECRET_KEY }}
70+
aws-region: ap-northeast-2
71+
72+
- name: Add Github Actions IP to Security group
73+
run: |
7174
aws ec2 authorize-security-group-ingress --group-id ${{ secrets.AWS_TEST_MIGRATE_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32
7275
73-
- name: executing docker-compose up on test server
74-
uses: appleboy/ssh-action@master
75-
with:
76-
host: ${{ secrets.TEST_MIGRATE_SERVER_HOST }}
77-
username: ${{ secrets.TEST_MIGRATE_SERVER_USERNAME }}
78-
key: ${{ secrets.TEST_MIGRATE_SERVER_PEM }}
79-
script: |
80-
cd /home/ec2-user/docker
81-
docker-compose down tomcat
82-
docker rmi ${{ env.IMAGE_NAME }}:latest
83-
docker-compose up tomcat -d
84-
docker-compose up prometheus -d
85-
86-
- name: Remove Github Actions IP From Security Group
87-
run: |
76+
- name: executing docker-compose up on test server
77+
uses: appleboy/ssh-action@master
78+
with:
79+
host: ${{ secrets.TEST_MIGRATE_SERVER_HOST }}
80+
username: ${{ secrets.TEST_MIGRATE_SERVER_USERNAME }}
81+
key: ${{ secrets.TEST_MIGRATE_SERVER_PEM }}
82+
script: |
83+
cd /home/ec2-user/docker
84+
docker-compose down tomcat
85+
docker rmi ${{ env.IMAGE_NAME }}:latest
86+
docker-compose up tomcat -d
87+
docker-compose up prometheus -d
88+
89+
- name: Remove Github Actions IP From Security Group
90+
run: |
8891
aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_TEST_MIGRATE_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ build/
44
!gradle/wrapper/gradle-wrapper.jar
55
!**/src/main/**/build/
66
!**/src/test/**/build/
7-
src/main/resources/application.yml
8-
src/main/resources/application-local.yml
9-
src/main/resources/application-main.yml
10-
src/main/resources/application-test.yml
7+
gg-pingpong-api/src/main/resources/application.yml
118
.DS_Store
12-
src/test/resources/application.yml
13-
src/test/resources/application-local.yml
149
python
1510
/logs
1611

@@ -54,4 +49,4 @@ pingping.pem
5449
./logs/*
5550

5651
### git commit message convention file ###
57-
.gitmessage.txt
52+
.gitmessage.txt

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ FROM openjdk:11-jdk
22

33
WORKDIR /app
44

5-
ARG JAR_FILE=build/libs/server-42gg.jar
5+
ARG JAR_FILE=gg-pingpong-api/build/libs/gg-pingpong-api-42gg.jar
66

77
COPY ${JAR_FILE} .
88

99
EXPOSE 8080
10-
ENTRYPOINT ["java","-jar","server-42gg.jar", \
10+
ENTRYPOINT ["java","-jar","gg-pingpong-api-42gg.jar", \
1111
"--spring.profiles.active=${PROFILE}", \
1212
"--spring.security.oauth2.client.registration.42.client-id=${SPRING_42_CLIENT_ID}", \
1313
"--spring.security.oauth2.client.registration.42.client-secret=${SPRING_42_CLIENT_SECRET}"]

0 commit comments

Comments
 (0)