From d81986beca8f43ca389b60af2aaa6a969a38e056 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Fri, 3 Feb 2023 15:06:50 +0900 Subject: [PATCH 01/12] =?UTF-8?q?#34=20CI=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=9C=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../food/service/FoodServiceImplTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java diff --git a/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java b/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java new file mode 100644 index 0000000..4cfcf1f --- /dev/null +++ b/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java @@ -0,0 +1,37 @@ +package com.example.myongsick.domain.food.service; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.*; + +import com.example.myongsick.domain.food.dto.response.WeekFoodResponse; +import com.example.myongsick.domain.food.repository.DinnerRepository; +import com.example.myongsick.domain.food.repository.LunchRepository; +import com.example.myongsick.domain.food.repository.WeekRepository; +import java.util.List; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.transaction.annotation.Transactional; + +@Transactional +@SpringBootTest +class FoodServiceImplTest { + + @Autowired FoodServiceImpl foodService; + @Autowired WeekRepository weekRepository; + @Autowired DinnerRepository dinnerRepository; + @Autowired LunchRepository lunchRepository; + + @Test + @DisplayName("주간 식단 조회시, 값이 없는 경우 - 예외") + void 주간식단조회_NoSuchElement() { + // given + + // when + + // then + assertThrows(NoSuchElementException.class, () -> foodService.getWeekFoods()); + } +} \ No newline at end of file From 3aee451cf127335d79b531c718b7e62c504f0464 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Fri, 3 Feb 2023 15:14:32 +0900 Subject: [PATCH 02/12] =?UTF-8?q?#34=20CI=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=9C=20=EC=8B=A4=ED=8C=A8=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=BC=80=EC=9D=B4=EC=8A=A4=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../myongsick/domain/food/service/FoodServiceImplTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java b/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java index 4cfcf1f..72b5feb 100644 --- a/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java +++ b/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java @@ -34,4 +34,10 @@ class FoodServiceImplTest { // then assertThrows(NoSuchElementException.class, () -> foodService.getWeekFoods()); } + + @Test + @DisplayName("주간 식단 조회시, 값이 없는 경우 - 실패") + void 주간식단조회_실패() { + assertThrows(IndexOutOfBoundsException.class, () -> foodService.getWeekFoods()); + } } \ No newline at end of file From 7680ae65e67b6865a75a22f7494b5618246fd95f Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 13:44:36 +0900 Subject: [PATCH 03/12] =?UTF-8?q?#34=20DEV=20=EC=84=9C=EB=B2=84=20CD=20?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=20=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD-Dev.yml | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/CD-Dev.yml diff --git a/.github/workflows/CD-Dev.yml b/.github/workflows/CD-Dev.yml new file mode 100644 index 0000000..3d7f4b7 --- /dev/null +++ b/.github/workflows/CD-Dev.yml @@ -0,0 +1,83 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CD with Gradle + +on: + pull_request: + branches: [ "develop" ] + +permissions: write-all + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + # 1) 워크플로우 실행 전 기본적으로 체크아웃 필요 + - uses: actions/checkout@v3 + + # 2) JDK 11 버전 설치 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + # 3) Gradle Caching + - name: Gradle Cashing + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + # 4) Gradle 권한 부여 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + # 5) Build exclude test package + #- name: Build with gradle + # run: ./gradlew build -x test + + # 6) Set for yml + - name: Make application-secret.yml + run: | + cd ./src/main/resources + touch ./application-secret.yml + echo "${{ secrets.PROPERTIES_TEST }}" > ./application-secret.yml + shell: bash + + # 7) 빌드 + - name: Build with gradle + run: ./gradlew bootJar + + # 8) Docker 빌드 & 푸쉬 + - name: docker build and push + run: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker build -f Dockerfile -t myongsick_dev . + docker tag myongsick_dev ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + docker push ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + + # 9) Deploy + - name: Deploy + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.EC2_HOST }} + username: ${{ secrets.EC2_USERNAME }} + key: ${{ secrets.EC2_KEY }} + script: | + docker stop myongsick_dev + docker rm myongsick_dev + sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + sudo docker run -d —name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + docker rmi -f $(docker images -f "dangling=true" -q) \ No newline at end of file From 91fb610fe139977583c1e2dd535bf973c03c1453 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 13:55:35 +0900 Subject: [PATCH 04/12] =?UTF-8?q?#34=20=EB=8F=84=EC=BB=A4=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=84=88=20=EA=B5=AC=EB=8F=99=20=EC=97=AC?= =?UTF-8?q?=EB=B6=80=20=ED=99=95=EC=9D=B8=20=EA=B5=AC=EB=AC=B8=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD-Dev.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CD-Dev.yml b/.github/workflows/CD-Dev.yml index 3d7f4b7..791a4e0 100644 --- a/.github/workflows/CD-Dev.yml +++ b/.github/workflows/CD-Dev.yml @@ -76,8 +76,8 @@ jobs: username: ${{ secrets.EC2_USERNAME }} key: ${{ secrets.EC2_KEY }} script: | - docker stop myongsick_dev - docker rm myongsick_dev sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + docker ps -q --filter name=myongsick_dev | grep -q . && docker rm -f $(docker ps -aq --filter name=myongsick_dev) + docker rm $(docker ps -a -q) + docker rmi -f $(docker images -f "dangling=true" -q) sudo docker run -d —name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev - docker rmi -f $(docker images -f "dangling=true" -q) \ No newline at end of file From 89ff281530d1caf9be5e37c3a4963ef415f76dde Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 13:59:37 +0900 Subject: [PATCH 05/12] =?UTF-8?q?#34=20=EB=8F=84=EC=BB=A4=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=84=88=20=EA=B5=AC=EB=8F=99=20=EC=97=AC?= =?UTF-8?q?=EB=B6=80=20=ED=99=95=EC=9D=B8=20=EA=B5=AC=EB=AC=B8=20=EC=9E=84?= =?UTF-8?q?=EC=8B=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD-Dev.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/CD-Dev.yml b/.github/workflows/CD-Dev.yml index 791a4e0..c4705ee 100644 --- a/.github/workflows/CD-Dev.yml +++ b/.github/workflows/CD-Dev.yml @@ -77,7 +77,5 @@ jobs: key: ${{ secrets.EC2_KEY }} script: | sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik-dev - docker ps -q --filter name=myongsick_dev | grep -q . && docker rm -f $(docker ps -aq --filter name=myongsick_dev) - docker rm $(docker ps -a -q) - docker rmi -f $(docker images -f "dangling=true" -q) sudo docker run -d —name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + docker rmi -f $(docker images -f "dangling=true" -q) \ No newline at end of file From 9ea33ec6081135317696c4ce96ab201416388600 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 14:05:03 +0900 Subject: [PATCH 06/12] =?UTF-8?q?#34=20=EB=8F=84=EC=BB=A4=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=20=EC=8B=9C,=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=ED=83=9C=EA=B7=B8=EB=AA=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD-Dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CD-Dev.yml b/.github/workflows/CD-Dev.yml index c4705ee..a9ae145 100644 --- a/.github/workflows/CD-Dev.yml +++ b/.github/workflows/CD-Dev.yml @@ -77,5 +77,5 @@ jobs: key: ${{ secrets.EC2_KEY }} script: | sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik-dev - sudo docker run -d —name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + sudo docker run -d —name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev:latest docker rmi -f $(docker images -f "dangling=true" -q) \ No newline at end of file From 1487ab8bef1cd25e9557e6cb4b10c2c4637c3875 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 14:14:46 +0900 Subject: [PATCH 07/12] =?UTF-8?q?#34=20=EB=8F=84=EC=BB=A4=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=20=EC=A4=91=EC=9D=B8=20=EC=BB=A8=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=84=88=20=EC=A4=91=EC=A7=80=20=EA=B5=AC=EB=AC=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD-Dev.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CD-Dev.yml b/.github/workflows/CD-Dev.yml index a9ae145..0d13168 100644 --- a/.github/workflows/CD-Dev.yml +++ b/.github/workflows/CD-Dev.yml @@ -76,6 +76,8 @@ jobs: username: ${{ secrets.EC2_USERNAME }} key: ${{ secrets.EC2_KEY }} script: | + docker stop myongsick_dev + docker rm myongsick_dev sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik-dev - sudo docker run -d —name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev:latest + sudo docker run -d --name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev:latest docker rmi -f $(docker images -f "dangling=true" -q) \ No newline at end of file From fe7bb71020d7895bac4d6eabebc69bc7620b18ed Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 14:38:15 +0900 Subject: [PATCH 08/12] =?UTF-8?q?#34=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{CI-Dev.yml => CI_Dev.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{CI-Dev.yml => CI_Dev.yml} (100%) diff --git a/.github/workflows/CI-Dev.yml b/.github/workflows/CI_Dev.yml similarity index 100% rename from .github/workflows/CI-Dev.yml rename to .github/workflows/CI_Dev.yml From c4afa710dd12a5d2b717cd1a7b8ccb5cc9205cc3 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 14:38:48 +0900 Subject: [PATCH 09/12] =?UTF-8?q?#34=20DEV=EC=97=90=EC=84=9C=20PROD?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{CD-Dev.yml => CD_Prod.yml} | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename .github/workflows/{CD-Dev.yml => CD_Prod.yml} (79%) diff --git a/.github/workflows/CD-Dev.yml b/.github/workflows/CD_Prod.yml similarity index 79% rename from .github/workflows/CD-Dev.yml rename to .github/workflows/CD_Prod.yml index 0d13168..08d98ce 100644 --- a/.github/workflows/CD-Dev.yml +++ b/.github/workflows/CD_Prod.yml @@ -9,7 +9,7 @@ name: Java CD with Gradle on: pull_request: - branches: [ "develop" ] + branches: [ "main" ] permissions: write-all @@ -64,9 +64,9 @@ jobs: - name: docker build and push run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -f Dockerfile -t myongsick_dev . - docker tag myongsick_dev ${{ secrets.DOCKER_USERNAME }}/myongsik-dev - docker push ${{ secrets.DOCKER_USERNAME }}/myongsik-dev + docker build -f Dockerfile -t myongsik_prod1 . + docker tag myongsik_prod1 ${{ secrets.DOCKER_USERNAME }}/myongsik + docker push ${{ secrets.DOCKER_USERNAME }}/myongsik # 9) Deploy - name: Deploy @@ -76,8 +76,8 @@ jobs: username: ${{ secrets.EC2_USERNAME }} key: ${{ secrets.EC2_KEY }} script: | - docker stop myongsick_dev - docker rm myongsick_dev - sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik-dev - sudo docker run -d --name myongsick_dev -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=dev -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik-dev:latest + docker stop myongsik_dev + docker rm myongsik_dev + sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik + sudo docker run -d --name myongsik_prod1 -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=prod -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik:latest docker rmi -f $(docker images -f "dangling=true" -q) \ No newline at end of file From 4eabe6f22ceee9b41d255c0ec6ee8c1ec4755304 Mon Sep 17 00:00:00 2001 From: dldmsql Date: Tue, 7 Feb 2023 14:42:07 +0900 Subject: [PATCH 10/12] =?UTF-8?q?#34=20=EC=8B=A4=ED=8C=A8=20=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=EC=9D=98=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A3=BC=EC=84=9D=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/food/service/FoodServiceImplTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java b/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java index 72b5feb..62ca74b 100644 --- a/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java +++ b/src/test/java/com/example/myongsick/domain/food/service/FoodServiceImplTest.java @@ -35,9 +35,9 @@ class FoodServiceImplTest { assertThrows(NoSuchElementException.class, () -> foodService.getWeekFoods()); } - @Test - @DisplayName("주간 식단 조회시, 값이 없는 경우 - 실패") - void 주간식단조회_실패() { - assertThrows(IndexOutOfBoundsException.class, () -> foodService.getWeekFoods()); - } +// @Test +// @DisplayName("주간 식단 조회시, 값이 없는 경우 - 실패") +// void 주간식단조회_실패() { +// assertThrows(IndexOutOfBoundsException.class, () -> foodService.getWeekFoods()); +// } } \ No newline at end of file From a49d04b7be0b90bf78b29a49facc500fceb03791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9D=80=EB=B9=84?= <61505572+dldmsql@users.noreply.github.com> Date: Tue, 7 Feb 2023 14:48:10 +0900 Subject: [PATCH 11/12] =?UTF-8?q?CD=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EC=98=A4=ED=83=88=EC=9E=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD_Prod.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CD_Prod.yml b/.github/workflows/CD_Prod.yml index 08d98ce..64f0387 100644 --- a/.github/workflows/CD_Prod.yml +++ b/.github/workflows/CD_Prod.yml @@ -76,8 +76,8 @@ jobs: username: ${{ secrets.EC2_USERNAME }} key: ${{ secrets.EC2_KEY }} script: | - docker stop myongsik_dev - docker rm myongsik_dev + docker stop myongsick_dev + docker rm myongsick_dev sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik sudo docker run -d --name myongsik_prod1 -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=prod -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik:latest - docker rmi -f $(docker images -f "dangling=true" -q) \ No newline at end of file + docker rmi -f $(docker images -f "dangling=true" -q) From c8207dc20d142cd049740f275784e12229486369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9D=80=EB=B9=84?= <61505572+dldmsql@users.noreply.github.com> Date: Tue, 7 Feb 2023 14:53:18 +0900 Subject: [PATCH 12/12] =?UTF-8?q?prod1=20=EB=8F=84=EC=BB=A4=20=EC=BB=A8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=84=88=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD_Prod.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CD_Prod.yml b/.github/workflows/CD_Prod.yml index 64f0387..4be97e8 100644 --- a/.github/workflows/CD_Prod.yml +++ b/.github/workflows/CD_Prod.yml @@ -76,8 +76,8 @@ jobs: username: ${{ secrets.EC2_USERNAME }} key: ${{ secrets.EC2_KEY }} script: | - docker stop myongsick_dev - docker rm myongsick_dev + docker stop myongsik_prod1 + docker rm myongsik_prod1 sudo docker pull ${{ secrets.DOCKER_USERNAME }}/myongsik sudo docker run -d --name myongsik_prod1 -v /etc/localtime:/etc/localtime:ro -e JAVA_OPTS=-Djasypt.encryptor.password=${{ secrets.YML_PASSWORD }} -e TZ=Asia/Seoul -e ENVIRONMENT_VALUE=-Dspring.profiles.active=prod -p 8081:8080 ${{ secrets.DOCKER_USERNAME }}/myongsik:latest docker rmi -f $(docker images -f "dangling=true" -q)