-
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.
Merge pull request #4 from youKeon/dev
Dev
- Loading branch information
Showing
74 changed files
with
2,845 additions
and
228 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,7 @@ | ||
// 파일명을 .env로 변경 후 원하시는 비밀번호를 설정해 주세요 | ||
// Github에 노출되지 않게 ignore 처리 부탁드립니다! | ||
|
||
DB_USERNAME=root | ||
DB_ROOT_PASSWORD= | ||
DB_DATABASE=psq | ||
DB_HOST=mysql |
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,47 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
|
||
env: | ||
S3_BUCKET_NAME: problemsolvingqueue | ||
PROJECT_NAME: psq | ||
|
||
jobs: | ||
build: | ||
name: CD | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'zulu' | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
shell: bash | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew build | ||
shell: bash | ||
|
||
- name: Make zip file | ||
run: zip -r ./$GITHUB_SHA.zip . | ||
shell: bash | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Copy script | ||
run: cp ./scripts/*.sh ./deploy | ||
|
||
- name: Upload to S3 | ||
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$PROJECT_NAME/$GITHUB_SHA.zip |
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,48 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["dev"] | ||
pull_request: | ||
branches: ["dev"] | ||
|
||
jobs: | ||
backend-test: | ||
permissions: | ||
contents: read | ||
checks: write | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 11 | ||
distribution: "temurin" | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: backend/.gradle | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('backend/**/*') }} | ||
restore-keys: ${{ runner.os }}-gradle- | ||
|
||
- name: Grant Execute Permission For Gradlew | ||
run: chmod +x backend/gradlew | ||
|
||
|
||
- name: Test with Gradle | ||
run: | | ||
cd backend | ||
./gradlew build --info | ||
- name: Test Report | ||
uses: dorny/test-reporter@v1 | ||
if: always() | ||
with: | ||
name: Tests Result | ||
path: "backend/build/test-results/**/*.xml" | ||
reporter: java-junit |
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 |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
.DS_Store | ||
|
||
backend/src/main/resources/application-local.yml | ||
|
||
.env | ||
|
||
.idea/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
FROM openjdk:11-jre-slim-buster | ||
VOLUME /tmp | ||
|
||
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait | ||
RUN chmod +x /wait | ||
|
||
COPY ./build/libs/solving-0.0.1-SNAPSHOT.jar app.jar | ||
CMD /wait && java -jar /app.jar --spring.profiles.active=prod |
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,23 @@ | ||
version: 0.0 | ||
os: linux | ||
|
||
files: | ||
- source: / | ||
destination: /home/ubuntu/app | ||
overwrite: yes | ||
|
||
permissions: | ||
- object: / | ||
pattern: "**" | ||
owner: ubuntu | ||
group: ubuntu | ||
|
||
hooks: | ||
AfterInstall: | ||
- location: scripts/stop.sh | ||
timeout: 60 | ||
runas: ubuntu | ||
ApplicationStart: | ||
- location: scripts/start.sh | ||
timeout: 60 | ||
runas: ubuntu |
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,24 @@ | ||
#!/bin/bash | ||
BUILD_JAR=$(ls /home/ubuntu/app/build/libs/*.jar) | ||
JAR_NAME=$(basename $BUILD_JAR) | ||
echo "> build 파일명: $JAR_NAME" >> /home/ubuntu/app/deploy.log | ||
|
||
echo "> build 파일 복사" >> /home/ubuntu/app/deploy.log | ||
DEPLOY_PATH=/home/ubuntu/app/action/ | ||
cp $BUILD_JAR $DEPLOY_PATH | ||
|
||
echo "> 현재 실행중인 애플리케이션 pid 확인" >> /home/ubuntu/app/deploy.log | ||
CURRENT_PID=$(pgrep -f $JAR_NAME) | ||
|
||
if [ -z $CURRENT_PID ] | ||
then | ||
echo "> 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다." >> /home/ubuntu/app/deploy.log | ||
else | ||
echo "> kill -15 $CURRENT_PID" | ||
kill -15 $CURRENT_PID | ||
sleep 5 | ||
fi | ||
|
||
DEPLOY_JAR=$DEPLOY_PATH$JAR_NAME | ||
echo "> DEPLOY_JAR 배포" >> /home/ubuntu/app/deploy.log | ||
nohup java -jar $DEPLOY_JAR >> /home/ubuntu/deploy.log 2>/home/ubuntu/app/deploy_err.log & |
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,2 @@ | ||
config.stopBubbling = true | ||
lombok.addLombokGeneratedAnnotation = true |
Oops, something went wrong.