Skip to content
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

[dev] Cloud 이동 #631

Merged
merged 7 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .github/workflows/be-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ jobs:
push: true
tags: ${{ secrets.BE_DOCKER_IMAGE_NAME }}
- name: 어플리케이션을 배포한다
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_ADDRESS }}
username: ${{ secrets.HOST_USERNAME }}
key: ${{ secrets.HOST_KEY }}
port: ${{ secrets.HOST_PORT }}
script: |
env:
PRIVATE_KEY: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
HOST: ${{ secrets.HOST_ADDRESS }}
USER: ${{ secrets.HOST_USERNAME }}
TAG: ${{ secrets.BE_DOCKER_IMAGE_NAME }}
run: |
# Private key를 파일로 생성합니다.
echo "$PRIVATE_KEY" > private_key.pem
chmod 600 private_key.pem

# EC2 인스턴스에 SSH로 접속하여 Docker 컨테이너를 관리합니다.
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST "
sudo docker compose -f docker-compose-be-app.yml down -v
sudo docker compose -f docker-compose-be-app.yml pull
sudo docker compose -f docker-compose-be-app.yml up -d
sudo docker image prune -f
sudo docker image prune -f
"
5 changes: 1 addition & 4 deletions .github/workflows/be-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,4 @@ jobs:
chmod +x gradlew
./gradlew build
working-directory: ${{ env.ROOT_PATH }}
- name: CoverAlls를 실행한다
uses: coverallsapp/github-action@v2
with:
base-path: COVERALLS_PATH

20 changes: 13 additions & 7 deletions .github/workflows/fe-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,20 @@ jobs:
push: true
tags: ${{ secrets.FE_DOCKER_IMAGE_NAME }}
- name: 어플리케이션을 배포한다
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_ADDRESS }}
username: ${{ secrets.HOST_USERNAME }}
key: ${{ secrets.HOST_KEY }}
port: ${{ secrets.HOST_PORT }}
script: |
env:
PRIVATE_KEY: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
HOST: ${{ secrets.HOST_ADDRESS }}
USER: ${{ secrets.HOST_USERNAME }}
TAG: ${{ secrets.BE_DOCKER_IMAGE_NAME }}
run: |
# Private key를 파일로 생성합니다.
echo "$PRIVATE_KEY" > private_key.pem
chmod 600 private_key.pem

# EC2 인스턴스에 SSH로 접속하여 Docker 컨테이너를 관리합니다.
ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST "
sudo docker compose -f docker-compose-fe-app.yml down -v
sudo docker compose -f docker-compose-fe-app.yml pull
sudo docker compose -f docker-compose-fe-app.yml up -d
sudo docker image prune -f
"
2 changes: 1 addition & 1 deletion Dockerfile.be
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM openjdk:11
COPY ./be/build/libs/*.jar app.jar
ENTRYPOINT ["java","-Dspring.config.location=file:/etc/be/conf/","-jar","app.jar","--spring.profiles.active=dev"]
ENTRYPOINT ["java","-Dspring.config.location=file:/be/conf/","-jar","app.jar","--spring.profiles.active=dev"]
3 changes: 3 additions & 0 deletions be/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'

// querydsl
implementation "com.querydsl:querydsl-jpa"
implementation "com.querydsl:querydsl-core"
Expand Down
2 changes: 1 addition & 1 deletion be/src/main/resources/application-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ filter:
POST /api/images,GET /api/feed/.*/comments/.*/replies,GET /api/feed/.*/comments/.*/replies/.*,
GET /api/feed_collections, GET /api/feed_collections/.*,
GET /api/stores/.*, GET /api/stores/search, GET /api/feed_collections/.*/comments,
GET /api/auth/oauth/google
GET /api/auth/oauth/google, GET /actuator/.*, GET /actuator
6 changes: 2 additions & 4 deletions be/src/main/resources/application-localdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ spring:
username: bono
password: 1111
jpa:
show-sql: true
# show-sql: true
hibernate:
ddl-auto: create-drop
properties:
hibernate:
format_sql: true

Loading