Skip to content

Commit

Permalink
fix: cicd파일 및 application.yml 파일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SunYerim committed Jul 5, 2024
1 parent 8858f10 commit 548b374
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ jobs:
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build --no-daemon
env:
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
NAVER_CLOVA_ID: ${{ secrets.NAVER_CLOVA_ID }}
NAVER_CLOVA_KEY: ${{ secrets.NAVER_CLOVA_KEY }}
run: ./gradlew build

- name: Log in to Docker Hub
uses: docker/login-action@v3
Expand All @@ -37,8 +41,8 @@ jobs:

- name: Build and push Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/sunjoo:sentimentAnalysis .
docker push ${{ secrets.DOCKER_USERNAME }}/sunjoo:sentimentAnalysis
docker build -t ${{ secrets.DOCKER_USERNAME }}/sentimentAnalysis:latest .
docker push ${{ secrets.DOCKER_USERNAME }}/sentimentAnalysis:latest
- name: SSH and Deploy
uses: appleboy/ssh-action@v0.1.5
Expand All @@ -48,7 +52,10 @@ jobs:
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
docker pull ${{ secrets.DOCKER_USERNAME }}/sentimentAnalysis
docker stop sunjoo || true
docker rm sunjoo || true
docker run -d -p 8082:8082 --name sunjoo ${{ secrets.DOCKER_USERNAME }}/sunjoo:sentimentAnalysis
cd /home/ubuntu/sunjoo-server-sentimentAnalysis
docker-compose down
docker pull ${{ secrets.DOCKER_USERNAME }}/sentimentAnalysis:latest
docker-compose build
docker-compose up -d
docker network connect eureka-network sunjoo-server-sentimentanalysis_sentimentanalysis_1
docker restart sunjoo-server-sentimentanalysis_sentimentanalysis_1
1 change: 1 addition & 0 deletions .idea/modules/sentimentAnalysis.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/libs/sentimentAnalysis-0.0.1-SNAPSHOT-plain.jar
Binary file not shown.
Binary file modified build/libs/sentimentAnalysis-0.0.1-SNAPSHOT.jar
Binary file not shown.
Binary file modified build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
9 changes: 6 additions & 3 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://sunjoo-sentimentanalysis.clau8wyu484y.ap-northeast-2.rds.amazonaws.com:3306/sunjoo?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true
username: root
password: sunjoo-sentimentanalysis0628
password: ${DB_PASSWORD}
jpa:
hibernate:
ddl-auto: validate


security:
api:
id: ${NAVER_CLOVA_ID}
key: ${NAVER_CLOVA_KEY}

eureka:
instance:
Expand All @@ -27,5 +30,5 @@ eureka:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://sunjoo-server-eureka-eureka-1:8761/eureka/
defaultZone: http://13.124.194.48:8761/eureka/

0 comments on commit 548b374

Please sign in to comment.