-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat#38] Github Action workflow 분리 및 mysql db production 적용 #43
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,57 @@ | ||
name: check | ||
|
||
on: [ pull_request, workflow_dispatch ] | ||
|
||
|
||
jobs: | ||
style: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
- name: Run Checkstyle | ||
run: ./gradlew checkstyleMain checkstyleTest | ||
- name: Make firebase-adminsdk.json | ||
run: | | ||
touch src/main/resources/timeet-firebase-adminsdk.json | ||
echo "${{ secrets.FIREBASE_ADMINSDK }}" | base64 --decode > src/main/resources/timeet-firebase-adminsdk.json | ||
- name: Make application-prod.yml | ||
run: | | ||
touch src/main/resources/application-prod.yml | ||
echo "${{ secrets.APPLICATION_PROD }}" | base64 --decode > src/main/resources/application-prod.yml | ||
- name: Make application-test.yml | ||
run: | | ||
touch src/main/resources/application-test.yml | ||
echo "${{ secrets.APPLICATION_TEST }}" | base64 --decode > src/main/resources/application-test.yml | ||
- name: Cache SonarQube packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
- name: Build and analyze | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
run: ./gradlew clean build sonar --info | ||
|
||
- name: Verify JAR File Exists | ||
run: | | ||
ls -l ./build/libs/ | ||
if [ -z "$(ls -A ./build/libs/*.jar)" ]; then | ||
echo "No JAR files found in ./build/libs directory." | ||
exit 1 | ||
fi |
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,3 +1,4 @@ | ||
.env | ||
timeet-firebase-adminsdk.json | ||
HELP.md | ||
.gradle | ||
|
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,18 +1,25 @@ | ||
version: '3.7' | ||
services: | ||
db: | ||
image: mysql:8-oracle | ||
restart: always | ||
environment: | ||
MYSQL_DATABASE: '{MYSQL_DATABASE}' | ||
MYSQL_USER: '${MYSQL_USER}' | ||
MYSQL_PASSWORD: '${MYSQL_PASSWORD}' | ||
MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD}' | ||
Comment on lines
+6
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 환경변수 사용해서 설정값 분리 잘 하셨습니다!! 💯 보안상 이슈는 없어보여요! 👏 |
||
ports: | ||
- '3306:3306' | ||
volumes: | ||
- db_data:/var/lib/mysql | ||
|
||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
environment: # 환경 변수 설정 | ||
- SPRING_DATASOURCE_URL=jdbc:h2:file:/usr/src/app/data/mydb;DB_CLOSE_ON_EXIT=FALSE | ||
platform: linux/amd64 | ||
image: syw5141/dnd-10th-2-backend:latest | ||
ports: | ||
- "8080:8080" | ||
# h2data 볼륨을 컨테이너 내부의 /usr/src/app/data에 매핑 | ||
volumes: | ||
- h2data:/usr/src/app/data | ||
depends_on: | ||
- db | ||
|
||
# 볼륨 정의 (기본 설정 사용) | ||
volumes: | ||
h2data: | ||
db_data: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arm 아키텍처도 지원되는 이미지로 수정해주셔서 감사해요!!
제 노트북에서도 잘 작동하네요 😄