-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'be' of https://github.com/JNU-econovation/Gaebaljip int…
…o test/#359
- Loading branch information
Showing
301 changed files
with
2,007 additions
and
1,169 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
.github/workflows/testAndDeploy.yml → .github/workflows/devWorkflow.yml
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,7 +1,9 @@ | ||
name: testAndDeploy | ||
name: testAndDeploy_dev | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
types: | ||
- closed | ||
|
||
|
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,108 @@ | ||
name: testAndDeploy_prod | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- release | ||
types: | ||
- closed | ||
|
||
defaults: | ||
run: | ||
working-directory: ./BE/exceed | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
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: Cache Gradle | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build with Gradle Wrapper | ||
run: ./gradlew build | ||
|
||
- name: Jacoco Report to PR | ||
id: jacoco | ||
uses: madrapps/jacoco-report@v1.6.1 | ||
with: | ||
paths: ${{ github.workspace }}/**/build/reports/jacoco/test/jacocoTestReport.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Send docker-compose-prod.yml | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
source: ./BE/exceed/docker-compose-prod.yml | ||
target: /home/ubuntu/backend-deploy | ||
|
||
- name: Send resources-prod-environment | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
source: ./BE/exceed/resources/gaebaljip-prod-environment | ||
target: /home/ubuntu/backend-deploy | ||
|
||
- name: Create .env.prod file | ||
run: | | ||
echo "${{ secrets.ENV_PROD_VARS }}" > .env.prod | ||
- name: Send env.prod file | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
source: ./BE/exceed/.env.prod | ||
target: /home/ubuntu/backend-deploy | ||
|
||
- name: Docker Image Build | ||
run: docker build -f Dockerfile-prod -t ${{ secrets.DOCKER_HUB_USER_NAME }}/gaebaljip-prod:latest . | ||
|
||
- name: Docker Hub Login | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USER_NAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: docker Hub Push | ||
run: docker push ${{ secrets.DOCKER_HUB_USER_NAME }}/gaebaljip-prod:latest | ||
|
||
- name: SSH Deploy | ||
uses: appleboy/ssh-action@v1.0.3 | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
script: | | ||
cd backend-deploy/BE/exceed | ||
sudo docker compose down | ||
sudo docker pull ${{ secrets.DOCKER_HUB_USER_NAME }}/gaebaljip-prod:latest | ||
sudo docker-compose --env-file .env.prod -f docker-compose-prod.yml up -d | ||
sudo docker image prune -a -f | ||
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 |
---|---|---|
|
@@ -45,8 +45,7 @@ src/main/resources/static/docs/api-doc.html | |
|
||
### env | ||
.env | ||
env-dev | ||
|
||
.env.prod | ||
|
||
### jmh | ||
|
||
|
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,18 @@ | ||
FROM openjdk:17-oracle | ||
|
||
ENV TZ=Asia/Seoul | ||
|
||
# 앱을 위한 작업 디렉토리 설정 | ||
WORKDIR /app | ||
|
||
# JAR 파일 복사 | ||
ARG JAR_FILE="./build/libs/*.jar" | ||
COPY ${JAR_FILE} eatceed.jar | ||
|
||
# CSV 파일 복사 | ||
COPY ./food_data.csv ./food_data.csv | ||
|
||
EXPOSE 8080 | ||
|
||
# CMD 명령어에서 CSV 파일의 위치를 절대 경로로 지정 | ||
CMD ["java", "-jar", "-Dspring.profiles.active=prod", "eatceed.jar", "./food_data.csv"] |
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,76 @@ | ||
version: '3' | ||
services: | ||
eatceed-redis: | ||
image: redis:alpine | ||
container_name: gaebaljip-redis | ||
command: redis-server --port 6379 | ||
expose: | ||
- "6379" | ||
networks: | ||
- gaebaljip-network | ||
|
||
eatceed-backend: | ||
image: hwangdaesun/gaebaljip-prod:latest | ||
container_name: gaebaljip-spring | ||
ports: | ||
- 8080:8080 | ||
depends_on: | ||
- eatceed-redis | ||
environment: | ||
- RDS_DATABASE_ENDPOINT=${RDS_DATABASE_ENDPOINT} | ||
- RDS_PORT=${RDS_PORT} | ||
- RDS_DB_NAME=${RDS_DB_NAME} | ||
- RDS_DATABASE_USERNAME=${RDS_DATABASE_USERNAME} | ||
- RDS_DATABASE_PASSWORD=${RDS_DATABASE_PASSWORD} | ||
- S3_BUCKET_NAME=${S3_BUCKET_NAME} | ||
- CLOUD_AWS_ACCESS_KEY=${CLOUD_AWS_ACCESS_KEY} | ||
- CLOUD_AWS_SECRET_KEY=${CLOUD_AWS_SECRET_KEY} | ||
- JWT_SECRET=${JWT_SECRET} | ||
- SES_MAIL_ADDRESS=${SES_MAIL_ADDRESS} | ||
- ENCRYPTION_SPEC=${ENCRYPTION_SPEC} | ||
- ENCRYPTION_SECRET=${ENCRYPTION_SECRET} | ||
- ENCRYPTION_ALGORITHM=${ENCRYPTION_ALGORITHM} | ||
- SPRING_REDIS_HOST=gaebaljip-redis | ||
- SPRING_REDIS_PORT=6379 | ||
networks: | ||
- gaebaljip-network | ||
restart: "always" | ||
|
||
grafana: | ||
image: grafana/grafana:latest | ||
container_name: grafana | ||
restart: "always" | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- grafana-data:/var/lib/grafana | ||
- ./resources/gaebaljip-prod-environment/grafana/provisioning/:/etc/grafana/provisioning/ | ||
environment: | ||
- GF_SERVER_ROOT_URL=localhost:3000 | ||
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} | ||
depends_on: | ||
- prometheus | ||
networks: | ||
- gaebaljip-network | ||
|
||
prometheus: | ||
image: prom/prometheus:latest | ||
container_name: prometheus | ||
restart: "always" | ||
ports: | ||
- "9090:9090" | ||
volumes: | ||
- ./resources/gaebaljip-prod-environment/prometheus/config:/etc/prometheus/ | ||
- prometheus-data:/prometheus | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
- '--storage.tsdb.path=/prometheus' | ||
networks: | ||
- gaebaljip-network | ||
|
||
volumes: | ||
grafana-data: | ||
prometheus-data: | ||
|
||
networks: | ||
gaebaljip-network: |
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
19 changes: 19 additions & 0 deletions
19
BE/exceed/resources/gaebaljip-prod-environment/prometheus/config/prometheus.yml
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,19 @@ | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
alerting: | ||
alertmanagers: | ||
- static_configs: | ||
- targets: | ||
# - alertmanager:9093 | ||
rule_files: | ||
scrape_configs: | ||
- job_name: "prometheus" | ||
static_configs: | ||
- targets: ["localhost:9090"] | ||
#추가 | ||
- job_name: "spring-actuator" | ||
metrics_path: '/actuator/prometheus' | ||
scrape_interval: 1s | ||
static_configs: | ||
- targets: ['3.37.117.77:8080'] |
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
2 changes: 1 addition & 1 deletion
2
...ljip/exceed/dto/request/LoginRequest.java → ...adapter/in/auth/request/LoginRequest.java
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
8 changes: 4 additions & 4 deletions
8
...ed/food/adapter/in/GetFoodController.java → ...ed/adapter/in/food/GetFoodController.java
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
Oops, something went wrong.