Skip to content

Commit

Permalink
10주차 개발 내역 정리 (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagaldol authored Nov 11, 2023
2 parents c329c15 + d4ea44b commit 9424a2c
Show file tree
Hide file tree
Showing 54 changed files with 2,888 additions and 199 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ MYSQL_USERNAME="bungae"
MYSQL_PASSWORD="0000"
GOOGLE_MAP_API_KEY="API_KEY"
SSL_KEY_PASSWORD="bungae"
FLASK_MAIL_SERVER="http://localhost:5000"
23 changes: 23 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Java CI with Gradle

on:
pull_request:
branches:
- 'master'
- 'develop'
- 'weekly/**'

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Java CD on AWS EC2 with SSH Connection

on:
push:
branches:
- 'master'
- 'develop'
- 'weekly/**'

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH Remote Commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.REMOTE_IP }}
username: ${{ secrets.REMOTE_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: 22
script: |
cd Team3_BE
git pull
./gradlew clean build || exit 1 # 빌드 실패 시 스크립트 종료
# 환경변수 설정
set -a
source .env
set +a
./nohup.sh # 기존 서버 종료 후 백그라운드로 서버 실행
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ open-api-3.0.1.json

goorm.manifest

aws/
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ WORKDIR project
# Spring 소스 코드를 이미지에 복사
COPY . .

# DATABASE_URL을 환경 변수로 삽입
ENV DATABASE_URL=jdbc:mysql://mysql/bungaebowling_db

# API URL 삽입
ENV API_SERVER_URL=https://ka02fa9a0d9a2a.user-app.krampoline.com

# gradle 빌드 시 proxy 설정을 gradle.properties에 추가
RUN echo "systemProp.http.proxyHost=krmp-proxy.9rum.cc\nsystemProp.http.proxyPort=3128\nsystemProp.https.proxyHost=krmp-proxy.9rum.cc\nsystemProp.https.proxyPort=3128" > /root/.gradle/gradle.properties

Expand All @@ -25,9 +31,6 @@ RUN ./gradlew clean build
FROM builder AS final
COPY --from=builder /home/gradle/project/build/libs/server-0.0.1.jar .

# DATABASE_URL을 환경 변수로 삽입
ENV DATABASE_URL=jdbc:mysql://mysql/bungaebowling_db

# yml 선택
ENV PROFILE deploy

Expand Down
Loading

0 comments on commit 9424a2c

Please sign in to comment.