From 464c68ecc908f4b8764b0fb9f55577087a72c202 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 19:31:18 +0900 Subject: [PATCH 01/18] =?UTF-8?q?[config]=20=EB=B0=B0=ED=8F=AC=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버가 많아짐에 따라 3개의 인스턴스에 나누어 배포 - 변경이 있는 모듈만 다시 배포하도록 작성 (테스트) --- .github/workflows/dev-deploy.yml | 112 +++++++++++++++++++++++++++---- 1 file changed, 98 insertions(+), 14 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 8701c522..474e68b2 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -4,42 +4,126 @@ on: push: branches: - dev + - config/122-deploy-script jobs: - deploy: + changes: runs-on: ubuntu-latest - + outputs: + restaurant-exposure: ${{ steps.filter.outputs.restaurant-exposure }} + search: ${{ steps.filter.outputs.search }} + cache: ${{ steps.filter.outputs.cache }} + advertisement: ${{ steps.filter.outputs.advertisement }} + coupon: ${{ steps.filter.outputs.coupon }} + delivery-time: ${{ steps.filter.outputs.delivery-time }} + restaurant: ${{ steps.filter.outputs.restaurant }} steps: - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + restaurant-exposure: + - 'service/restaurant-exposure-service/**' + search: + - 'service/search-service/**' + cache: + - 'service/cache-service/**' + advertisement: + - 'service/advertisement-service/**' + coupon: + - 'service/coupon-service/**' + delivery-time: + - 'service/delivery-time-service/**' + restaurant: + - 'service/restaurant-service/**' - - name: JDK 17 설정 + build: + needs: changes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: JDK 21 설정 uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '21' distribution: 'zulu' - - name: gradlew 실행 권한 부여 run: chmod +x gradlew - - name: JAR 빌드 run: ./gradlew clean build - - name: JAR를 EC2로 전송 + deploy-restaurant-exposure: + needs: [ changes, build ] + if: ${{ needs.changes.outputs.restaurant-exposure == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: 가게노출 서비스 서버로 JAR 전송 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} - HOST: ${{ secrets.DEV_EC2_HOST }} + HOST: ${{ secrets.DEV_EC2_HOST1 }} USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - scp -o StrictHostKeyChecking=no -i private_key mono/build/libs/*.jar ${USER}@${HOST}:~/app.jar + scp -o StrictHostKeyChecking=no -i private_key service/restaurant-exposure-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-exposure-service.jar + - name: 가게노출 서비스 실행 + env: + PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} + HOST: ${{ secrets.DEV_EC2_HOST1 }} + USER: ${{ secrets.DEV_EC2_USER }} + run: | + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF + pkill -f 'java -jar restaurant-exposure-service.jar' || true + nohup java -jar restaurant-exposure-service.jar --spring.profiles.active=dev > restaurant-exposure-service.log 2>&1 & + EOF - - name: EC2에서 JAR 실행 + deploy-search: + needs: [ changes, build ] + if: ${{ needs.changes.outputs.search == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: 검색 서비스 서버로 JAR 전송 + env: + PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} + HOST: ${{ secrets.DEV_EC2_HOST2 }} + USER: ${{ secrets.DEV_EC2_USER }} + run: | + echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + scp -o StrictHostKeyChecking=no -i private_key service/search-service/build/libs/*.jar ${USER}@${HOST}:~/search-service.jar + - name: 검색 서비스 실행 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} - HOST: ${{ secrets.DEV_EC2_HOST }} + HOST: ${{ secrets.DEV_EC2_HOST2 }} USER: ${{ secrets.DEV_EC2_USER }} run: | ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF - pkill -f 'java -jar app.jar --spring.profiles.active=dev' || true - nohup java -jar app.jar --spring.profiles.active=dev > app.log 2>&1 & - EOF \ No newline at end of file + pkill -f 'java -jar search-service.jar' || true + nohup java -jar search-service.jar --spring.profiles.active=dev > search-service.log 2>&1 & + EOF + + deploy-other-services: + needs: [ changes, build ] + if: ${{ needs.changes.outputs.cache == 'true' || needs.changes.outputs.advertisement == 'true' || needs.changes.outputs.coupon == 'true' || needs.changes.outputs.delivery-time == 'true' || needs.changes.outputs.restaurant == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: 기타 서비스 서버로 JAR 전송 및 실행 + env: + PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} + HOST: ${{ secrets.DEV_EC2_HOST3 }} + USER: ${{ secrets.DEV_EC2_USER }} + run: | + echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + services=("cache" "advertisement" "coupon" "delivery-time" "restaurant") + for service in "${services[@]}"; do + if [[ "${{ needs.changes.outputs.$service }}" == 'true' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/${service}-service/build/libs/*.jar ${USER}@${HOST}:~/${service}-service.jar + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF + pkill -f 'java -jar ${service}-service.jar' || true + nohup java -jar ${service}-service.jar --spring.profiles.active=dev > ${service}-service.log 2>&1 & + EOF + fi + done + rm -f private_key From b15d931cf12d2664c6e528e20986493fd275fd98 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 19:33:45 +0900 Subject: [PATCH 02/18] =?UTF-8?q?[config]=20=EB=B0=B0=ED=8F=AC=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버가 많아짐에 따라 3개의 인스턴스에 나누어 배포 - 변경이 있는 모듈만 다시 배포하도록 작성 (테스트 2) --- .github/workflows/dev-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 474e68b2..0e0ebe4a 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -118,7 +118,7 @@ jobs: echo "$PRIVATE_KEY" > private_key && chmod 600 private_key services=("cache" "advertisement" "coupon" "delivery-time" "restaurant") for service in "${services[@]}"; do - if [[ "${{ needs.changes.outputs.$service }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs[format('{0}', service)] }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/${service}-service/build/libs/*.jar ${USER}@${HOST}:~/${service}-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar ${service}-service.jar' || true From a63701bc502b871144d78b919d5cba44a684ddf3 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 19:36:28 +0900 Subject: [PATCH 03/18] =?UTF-8?q?[config]=20=EB=B0=B0=ED=8F=AC=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버가 많아짐에 따라 3개의 인스턴스에 나누어 배포 - 변경이 있는 모듈만 다시 배포하도록 작성 (테스트 3) --- .github/workflows/dev-deploy.yml | 54 +++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 0e0ebe4a..d5ec9513 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -109,21 +109,53 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: 기타 서비스 서버로 JAR 전송 및 실행 + - name: 기타 서비스 서버로 JAR 전송 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} HOST: ${{ secrets.DEV_EC2_HOST3 }} USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - services=("cache" "advertisement" "coupon" "delivery-time" "restaurant") - for service in "${services[@]}"; do - if [[ "${{ needs.changes.outputs[format('{0}', service)] }}" == 'true' ]]; then - scp -o StrictHostKeyChecking=no -i private_key service/${service}-service/build/libs/*.jar ${USER}@${HOST}:~/${service}-service.jar - ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF - pkill -f 'java -jar ${service}-service.jar' || true - nohup java -jar ${service}-service.jar --spring.profiles.active=dev > ${service}-service.log 2>&1 & - EOF + if [[ "${{ needs.changes.outputs.cache }}" == 'true' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/cache-service/build/libs/*.jar ${USER}@${HOST}:~/cache-service.jar + fi + if [[ "${{ needs.changes.outputs.advertisement }}" == 'true' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/advertisement-service/build/libs/*.jar ${USER}@${HOST}:~/advertisement-service.jar + fi + if [[ "${{ needs.changes.outputs.coupon }}" == 'true' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/coupon-service/build/libs/*.jar ${USER}@${HOST}:~/coupon-service.jar + fi + if [[ "${{ needs.changes.outputs.delivery-time }}" == 'true' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/delivery-time-service/build/libs/*.jar ${USER}@${HOST}:~/delivery-time-service.jar + fi + if [[ "${{ needs.changes.outputs.restaurant }}" == 'true' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/restaurant-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-service.jar + fi + - name: 기타 서비스들 실행 + env: + PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} + HOST: ${{ secrets.DEV_EC2_HOST3 }} + USER: ${{ secrets.DEV_EC2_USER }} + run: | + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF + if [[ "${{ needs.changes.outputs.cache }}" == 'true' ]]; then + pkill -f 'java -jar cache-service.jar' || true + nohup java -jar cache-service.jar --spring.profiles.active=dev > cache-service.log 2>&1 & fi - done - rm -f private_key + if [[ "${{ needs.changes.outputs.advertisement }}" == 'true' ]]; then + pkill -f 'java -jar advertisement-service.jar' || true + nohup java -jar advertisement-service.jar --spring.profiles.active=dev > advertisement-service.log 2>&1 & + fi + if [[ "${{ needs.changes.outputs.coupon }}" == 'true' ]]; then + pkill -f 'java -jar coupon-service.jar' || true + nohup java -jar coupon-service.jar --spring.profiles.active=dev > coupon-service.log 2>&1 & + fi + if [[ "${{ needs.changes.outputs.delivery-time }}" == 'true' ]]; then + pkill -f 'java -jar delivery-time-service.jar' || true + nohup java -jar delivery-time-service.jar --spring.profiles.active=dev > delivery-time-service.log 2>&1 & + fi + if [[ "${{ needs.changes.outputs.restaurant }}" == 'true' ]]; then + pkill -f 'java -jar restaurant-service.jar' || true + nohup java -jar restaurant-service.jar --spring.profiles.active=dev > restaurant-service.log 2>&1 & + fi + EOF From 40d29d82ddc453509cc8930e367c1465c0a50a50 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 19:40:11 +0900 Subject: [PATCH 04/18] =?UTF-8?q?[config]=20=EB=AA=A8=EB=93=A0=20=EC=84=9C?= =?UTF-8?q?=EB=B9=84=EC=8A=A4=20=EB=B0=B0=ED=8F=AC=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버가 많아짐에 따라 3개의 인스턴스에 나누어 배포 - 변경이 있는 모듈만 다시 배포하도록 작성(임시로 모든 서버가 재배포되도록 구성) --- .github/workflows/dev-deploy.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index d5ec9513..342712f3 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -55,7 +55,7 @@ jobs: deploy-restaurant-exposure: needs: [ changes, build ] - if: ${{ needs.changes.outputs.restaurant-exposure == 'true' }} + if: ${{ needs.changes.outputs.restaurant-exposure == 'false' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -80,7 +80,7 @@ jobs: deploy-search: needs: [ changes, build ] - if: ${{ needs.changes.outputs.search == 'true' }} + if: ${{ needs.changes.outputs.search == 'false' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -116,19 +116,19 @@ jobs: USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - if [[ "${{ needs.changes.outputs.cache }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.cache }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/cache-service/build/libs/*.jar ${USER}@${HOST}:~/cache-service.jar fi - if [[ "${{ needs.changes.outputs.advertisement }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.advertisement }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/advertisement-service/build/libs/*.jar ${USER}@${HOST}:~/advertisement-service.jar fi - if [[ "${{ needs.changes.outputs.coupon }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.coupon }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/coupon-service/build/libs/*.jar ${USER}@${HOST}:~/coupon-service.jar fi - if [[ "${{ needs.changes.outputs.delivery-time }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.delivery-time }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/delivery-time-service/build/libs/*.jar ${USER}@${HOST}:~/delivery-time-service.jar fi - if [[ "${{ needs.changes.outputs.restaurant }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.restaurant }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/restaurant-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-service.jar fi - name: 기타 서비스들 실행 @@ -138,23 +138,23 @@ jobs: USER: ${{ secrets.DEV_EC2_USER }} run: | ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF - if [[ "${{ needs.changes.outputs.cache }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.cache }}" == 'false' ]]; then pkill -f 'java -jar cache-service.jar' || true nohup java -jar cache-service.jar --spring.profiles.active=dev > cache-service.log 2>&1 & fi - if [[ "${{ needs.changes.outputs.advertisement }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.advertisement }}" == 'false' ]]; then pkill -f 'java -jar advertisement-service.jar' || true nohup java -jar advertisement-service.jar --spring.profiles.active=dev > advertisement-service.log 2>&1 & fi - if [[ "${{ needs.changes.outputs.coupon }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.coupon }}" == 'false' ]]; then pkill -f 'java -jar coupon-service.jar' || true nohup java -jar coupon-service.jar --spring.profiles.active=dev > coupon-service.log 2>&1 & fi - if [[ "${{ needs.changes.outputs.delivery-time }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.delivery-time }}" == 'false' ]]; then pkill -f 'java -jar delivery-time-service.jar' || true nohup java -jar delivery-time-service.jar --spring.profiles.active=dev > delivery-time-service.log 2>&1 & fi - if [[ "${{ needs.changes.outputs.restaurant }}" == 'true' ]]; then + if [[ "${{ needs.changes.outputs.restaurant }}" == 'false' ]]; then pkill -f 'java -jar restaurant-service.jar' || true nohup java -jar restaurant-service.jar --spring.profiles.active=dev > restaurant-service.log 2>&1 & fi From 5362fdc7e15602884a376045da03b605ad14be45 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 19:55:33 +0900 Subject: [PATCH 05/18] =?UTF-8?q?[config]=20=EB=94=94=EB=B2=84=EA=B9=85=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버가 많아짐에 따라 3개의 인스턴스에 나누어 배포 - 변경이 있는 모듈만 다시 배포하도록 작성(임시로 모든 서버가 재배포되도록 구성) --- .github/workflows/dev-deploy.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 342712f3..1215cb3a 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -66,6 +66,14 @@ jobs: USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + + echo "Current directory:" + pwd + echo "Contents of current directory:" + ls -R + echo "Contents of build directory:" + ls -R service/search-service/build/libs/ + scp -o StrictHostKeyChecking=no -i private_key service/restaurant-exposure-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-exposure-service.jar - name: 가게노출 서비스 실행 env: @@ -91,6 +99,14 @@ jobs: USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + + echo "Current directory:" + pwd + echo "Contents of current directory:" + ls -R + echo "Contents of build directory:" + ls -R service/search-service/build/libs/ + scp -o StrictHostKeyChecking=no -i private_key service/search-service/build/libs/*.jar ${USER}@${HOST}:~/search-service.jar - name: 검색 서비스 실행 env: From aefe7833ac133c8027c5418208fbd02ea6794034 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 20:14:27 +0900 Subject: [PATCH 06/18] =?UTF-8?q?[config]=20=EC=95=84=ED=8B=B0=ED=8C=A9?= =?UTF-8?q?=ED=8A=B8=20=EC=97=85=EB=A1=9C=EB=93=9C,=20=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버가 많아짐에 따라 3개의 인스턴스에 나누어 배포 - 변경이 있는 모듈만 다시 배포하도록 작성(임시로 모든 서버가 재배포되도록 구성) --- .github/workflows/dev-deploy.yml | 52 +++++++++++++++++--------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 1215cb3a..9ccddd89 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -52,6 +52,11 @@ jobs: run: chmod +x gradlew - name: JAR 빌드 run: ./gradlew clean build + - name: 아티팩트 업로드 + uses: actions/upload-artifact@v3 + with: + name: jar-files + path: service/*/build/libs/*.jar deploy-restaurant-exposure: needs: [ changes, build ] @@ -59,6 +64,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: JAR 파일 다운로드 + uses: actions/download-artifact@v3 + with: + name: jar-files + path: jars - name: 가게노출 서비스 서버로 JAR 전송 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} @@ -66,15 +76,7 @@ jobs: USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - - echo "Current directory:" - pwd - echo "Contents of current directory:" - ls -R - echo "Contents of build directory:" - ls -R service/search-service/build/libs/ - - scp -o StrictHostKeyChecking=no -i private_key service/restaurant-exposure-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-exposure-service.jar + scp -o StrictHostKeyChecking=no -i private_key jars/restaurant-exposure-service-*.jar ${USER}@${HOST}:~/restaurant-exposure-service.jar - name: 가게노출 서비스 실행 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} @@ -92,6 +94,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: JAR 파일 다운로드 + uses: actions/download-artifact@v3 + with: + name: jar-files + path: jars - name: 검색 서비스 서버로 JAR 전송 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} @@ -99,15 +106,7 @@ jobs: USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - - echo "Current directory:" - pwd - echo "Contents of current directory:" - ls -R - echo "Contents of build directory:" - ls -R service/search-service/build/libs/ - - scp -o StrictHostKeyChecking=no -i private_key service/search-service/build/libs/*.jar ${USER}@${HOST}:~/search-service.jar + scp -o StrictHostKeyChecking=no -i private_key jars/search-service-*.jar ${USER}@${HOST}:~/search-service.jar - name: 검색 서비스 실행 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} @@ -121,10 +120,15 @@ jobs: deploy-other-services: needs: [ changes, build ] - if: ${{ needs.changes.outputs.cache == 'true' || needs.changes.outputs.advertisement == 'true' || needs.changes.outputs.coupon == 'true' || needs.changes.outputs.delivery-time == 'true' || needs.changes.outputs.restaurant == 'true' }} + if: ${{ needs.changes.outputs.cache == 'false' || needs.changes.outputs.advertisement == 'true' || needs.changes.outputs.coupon == 'true' || needs.changes.outputs.delivery-time == 'true' || needs.changes.outputs.restaurant == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: JAR 파일 다운로드 + uses: actions/download-artifact@v3 + with: + name: jar-files + path: jars - name: 기타 서비스 서버로 JAR 전송 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} @@ -133,19 +137,19 @@ jobs: run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key if [[ "${{ needs.changes.outputs.cache }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key service/cache-service/build/libs/*.jar ${USER}@${HOST}:~/cache-service.jar + scp -o StrictHostKeyChecking=no -i private_key jars/cache-service-*.jar ${USER}@${HOST}:~/cache-service.jar fi if [[ "${{ needs.changes.outputs.advertisement }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key service/advertisement-service/build/libs/*.jar ${USER}@${HOST}:~/advertisement-service.jar + scp -o StrictHostKeyChecking=no -i private_key jars/advertisement-service-*.jar ${USER}@${HOST}:~/advertisement-service.jar fi if [[ "${{ needs.changes.outputs.coupon }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key service/coupon-service/build/libs/*.jar ${USER}@${HOST}:~/coupon-service.jar + scp -o StrictHostKeyChecking=no -i private_key jars/coupon-service-*.jar ${USER}@${HOST}:~/coupon-service.jar fi if [[ "${{ needs.changes.outputs.delivery-time }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key service/delivery-time-service/build/libs/*.jar ${USER}@${HOST}:~/delivery-time-service.jar + scp -o StrictHostKeyChecking=no -i private_key jars/delivery-time-service-*.jar ${USER}@${HOST}:~/delivery-time-service.jar fi if [[ "${{ needs.changes.outputs.restaurant }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key service/restaurant-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-service.jar + scp -o StrictHostKeyChecking=no -i private_key jars/restaurant-service-*.jar ${USER}@${HOST}:~/restaurant-service.jar fi - name: 기타 서비스들 실행 env: From 6bcca8de5311d42b7d30b89e6c18f5dd5771f300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A7=80=EC=B0=AC=EC=9A=B0?= Date: Sun, 25 Aug 2024 20:19:55 +0900 Subject: [PATCH 07/18] test1 --- .github/workflows/dev-deploy.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 9ccddd89..5576bb7e 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -52,6 +52,10 @@ jobs: run: chmod +x gradlew - name: JAR 빌드 run: ./gradlew clean build + - name: 빌드된 JAR 파일 확인 + run: | + echo "빌드된 JAR 파일 목록:" + find service/*/build/libs -name "*.jar" - name: 아티팩트 업로드 uses: actions/upload-artifact@v3 with: @@ -60,7 +64,7 @@ jobs: deploy-restaurant-exposure: needs: [ changes, build ] - if: ${{ needs.changes.outputs.restaurant-exposure == 'false' }} + if: ${{ needs.changes.outputs.restaurant-exposure == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -69,6 +73,10 @@ jobs: with: name: jar-files path: jars + - name: 다운로드된 JAR 파일 확인 + run: | + echo "다운로드된 JAR 파일 목록:" + find jars -name "*.jar" - name: 가게노출 서비스 서버로 JAR 전송 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} @@ -76,7 +84,12 @@ jobs: USER: ${{ secrets.DEV_EC2_USER }} run: | echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - scp -o StrictHostKeyChecking=no -i private_key jars/restaurant-exposure-service-*.jar ${USER}@${HOST}:~/restaurant-exposure-service.jar + jar_file=$(find jars -name "restaurant-exposure-service*.jar") + if [ -z "$jar_file" ]; then + echo "Error: restaurant-exposure-service JAR file not found" + exit 1 + fi + scp -o StrictHostKeyChecking=no -i private_key "$jar_file" ${USER}@${HOST}:~/restaurant-exposure-service.jar - name: 가게노출 서비스 실행 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} From 5930d4cf39f06a80e5a685830863a2e07c8eedff Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 20:25:46 +0900 Subject: [PATCH 08/18] =?UTF-8?q?[config]=20=ED=95=98=EB=82=98=EC=9D=98=20?= =?UTF-8?q?job=EC=97=90=EC=84=9C=20=EC=8B=A4=ED=96=89=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버가 많아짐에 따라 3개의 인스턴스에 나누어 배포 - 변경이 있는 모듈만 다시 배포하도록 작성(임시로 모든 서버가 재배포되도록 구성) --- .github/workflows/dev-deploy.yml | 193 ++++++++++--------------------- 1 file changed, 64 insertions(+), 129 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 5576bb7e..24a7f8fd 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -7,20 +7,31 @@ on: - config/122-deploy-script jobs: - changes: + build-and-deploy: runs-on: ubuntu-latest - outputs: - restaurant-exposure: ${{ steps.filter.outputs.restaurant-exposure }} - search: ${{ steps.filter.outputs.search }} - cache: ${{ steps.filter.outputs.cache }} - advertisement: ${{ steps.filter.outputs.advertisement }} - coupon: ${{ steps.filter.outputs.coupon }} - delivery-time: ${{ steps.filter.outputs.delivery-time }} - restaurant: ${{ steps.filter.outputs.restaurant }} steps: - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter + + - name: JDK 21 설정 + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'zulu' + + - name: gradlew 실행 권한 부여 + run: chmod +x gradlew + + - name: JAR 빌드 + run: ./gradlew clean build + + - name: 빌드된 JAR 파일 확인 + run: | + echo "빌드된 JAR 파일 목록:" + find service/*/build/libs -name "*.jar" + + - name: 변경된 서비스 확인 + id: check_changes + uses: dorny/paths-filter@v2 with: filters: | restaurant-exposure: @@ -38,157 +49,81 @@ jobs: restaurant: - 'service/restaurant-service/**' - build: - needs: changes - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: JDK 21 설정 - uses: actions/setup-java@v3 - with: - java-version: '21' - distribution: 'zulu' - - name: gradlew 실행 권한 부여 - run: chmod +x gradlew - - name: JAR 빌드 - run: ./gradlew clean build - - name: 빌드된 JAR 파일 확인 - run: | - echo "빌드된 JAR 파일 목록:" - find service/*/build/libs -name "*.jar" - - name: 아티팩트 업로드 - uses: actions/upload-artifact@v3 - with: - name: jar-files - path: service/*/build/libs/*.jar - - deploy-restaurant-exposure: - needs: [ changes, build ] - if: ${{ needs.changes.outputs.restaurant-exposure == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: JAR 파일 다운로드 - uses: actions/download-artifact@v3 - with: - name: jar-files - path: jars - - name: 다운로드된 JAR 파일 확인 - run: | - echo "다운로드된 JAR 파일 목록:" - find jars -name "*.jar" - - name: 가게노출 서비스 서버로 JAR 전송 + - name: SSH 키 설정 env: PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} - HOST: ${{ secrets.DEV_EC2_HOST1 }} - USER: ${{ secrets.DEV_EC2_USER }} run: | - echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - jar_file=$(find jars -name "restaurant-exposure-service*.jar") - if [ -z "$jar_file" ]; then - echo "Error: restaurant-exposure-service JAR file not found" - exit 1 - fi - scp -o StrictHostKeyChecking=no -i private_key "$jar_file" ${USER}@${HOST}:~/restaurant-exposure-service.jar - - name: 가게노출 서비스 실행 + echo "$PRIVATE_KEY" > private_key + chmod 600 private_key + + - name: 가게노출 서비스 배포 + if: steps.check_changes.outputs.restaurant-exposure == 'false' env: - PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} HOST: ${{ secrets.DEV_EC2_HOST1 }} USER: ${{ secrets.DEV_EC2_USER }} run: | + scp -o StrictHostKeyChecking=no -i private_key service/restaurant-exposure-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-exposure-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-exposure-service.jar' || true nohup java -jar restaurant-exposure-service.jar --spring.profiles.active=dev > restaurant-exposure-service.log 2>&1 & EOF - deploy-search: - needs: [ changes, build ] - if: ${{ needs.changes.outputs.search == 'false' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: JAR 파일 다운로드 - uses: actions/download-artifact@v3 - with: - name: jar-files - path: jars - - name: 검색 서비스 서버로 JAR 전송 + - name: 검색 서비스 배포 + if: steps.check_changes.outputs.search == 'false' env: - PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} - HOST: ${{ secrets.DEV_EC2_HOST2 }} - USER: ${{ secrets.DEV_EC2_USER }} - run: | - echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - scp -o StrictHostKeyChecking=no -i private_key jars/search-service-*.jar ${USER}@${HOST}:~/search-service.jar - - name: 검색 서비스 실행 - env: - PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} HOST: ${{ secrets.DEV_EC2_HOST2 }} USER: ${{ secrets.DEV_EC2_USER }} run: | + scp -o StrictHostKeyChecking=no -i private_key service/search-service/build/libs/*.jar ${USER}@${HOST}:~/search-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar search-service.jar' || true nohup java -jar search-service.jar --spring.profiles.active=dev > search-service.log 2>&1 & EOF - deploy-other-services: - needs: [ changes, build ] - if: ${{ needs.changes.outputs.cache == 'false' || needs.changes.outputs.advertisement == 'true' || needs.changes.outputs.coupon == 'true' || needs.changes.outputs.delivery-time == 'true' || needs.changes.outputs.restaurant == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: JAR 파일 다운로드 - uses: actions/download-artifact@v3 - with: - name: jar-files - path: jars - - name: 기타 서비스 서버로 JAR 전송 + - name: 기타 서비스 배포 + if: | + steps.check_changes.outputs.cache == 'false' || + steps.check_changes.outputs.advertisement == 'false' || + steps.check_changes.outputs.coupon == 'false' || + steps.check_changes.outputs.delivery-time == 'false' || + steps.check_changes.outputs.restaurant == 'false' env: - PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} HOST: ${{ secrets.DEV_EC2_HOST3 }} USER: ${{ secrets.DEV_EC2_USER }} run: | - echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - if [[ "${{ needs.changes.outputs.cache }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key jars/cache-service-*.jar ${USER}@${HOST}:~/cache-service.jar - fi - if [[ "${{ needs.changes.outputs.advertisement }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key jars/advertisement-service-*.jar ${USER}@${HOST}:~/advertisement-service.jar - fi - if [[ "${{ needs.changes.outputs.coupon }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key jars/coupon-service-*.jar ${USER}@${HOST}:~/coupon-service.jar - fi - if [[ "${{ needs.changes.outputs.delivery-time }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key jars/delivery-time-service-*.jar ${USER}@${HOST}:~/delivery-time-service.jar - fi - if [[ "${{ needs.changes.outputs.restaurant }}" == 'false' ]]; then - scp -o StrictHostKeyChecking=no -i private_key jars/restaurant-service-*.jar ${USER}@${HOST}:~/restaurant-service.jar - fi - - name: 기타 서비스들 실행 - env: - PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }} - HOST: ${{ secrets.DEV_EC2_HOST3 }} - USER: ${{ secrets.DEV_EC2_USER }} - run: | - ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF - if [[ "${{ needs.changes.outputs.cache }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.cache }}" == 'false' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/cache-service/build/libs/*.jar ${USER}@${HOST}:~/cache-service.jar + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar cache-service.jar' || true nohup java -jar cache-service.jar --spring.profiles.active=dev > cache-service.log 2>&1 & - fi - if [[ "${{ needs.changes.outputs.advertisement }}" == 'false' ]]; then + EOF + fi + if [[ "${{ steps.check_changes.outputs.advertisement }}" == 'false' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/advertisement-service/build/libs/*.jar ${USER}@${HOST}:~/advertisement-service.jar + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar advertisement-service.jar' || true nohup java -jar advertisement-service.jar --spring.profiles.active=dev > advertisement-service.log 2>&1 & - fi - if [[ "${{ needs.changes.outputs.coupon }}" == 'false' ]]; then + EOF + fi + if [[ "${{ steps.check_changes.outputs.coupon }}" == 'false' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/coupon-service/build/libs/*.jar ${USER}@${HOST}:~/coupon-service.jar + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar coupon-service.jar' || true nohup java -jar coupon-service.jar --spring.profiles.active=dev > coupon-service.log 2>&1 & - fi - if [[ "${{ needs.changes.outputs.delivery-time }}" == 'false' ]]; then + EOF + fi + if [[ "${{ steps.check_changes.outputs.delivery-time }}" == 'false' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/delivery-time-service/build/libs/*.jar ${USER}@${HOST}:~/delivery-time-service.jar + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar delivery-time-service.jar' || true nohup java -jar delivery-time-service.jar --spring.profiles.active=dev > delivery-time-service.log 2>&1 & - fi - if [[ "${{ needs.changes.outputs.restaurant }}" == 'false' ]]; then + EOF + fi + if [[ "${{ steps.check_changes.outputs.restaurant }}" == 'false' ]]; then + scp -o StrictHostKeyChecking=no -i private_key service/restaurant-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-service.jar + ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-service.jar' || true nohup java -jar restaurant-service.jar --spring.profiles.active=dev > restaurant-service.log 2>&1 & - fi + EOF + fi EOF From daa1c488c698c84ff42179dd04bc4095af2f2c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A7=80=EC=B0=AC=EC=9A=B0?= Date: Sun, 25 Aug 2024 20:30:21 +0900 Subject: [PATCH 09/18] =?UTF-8?q?=EC=9D=B4=EC=A0=9C=20=EC=A7=84=EC=A7=9C?= =?UTF-8?q?=20=EB=90=9C=EB=8B=A4..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 24a7f8fd..a2bcc3ee 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -125,5 +125,4 @@ jobs: pkill -f 'java -jar restaurant-service.jar' || true nohup java -jar restaurant-service.jar --spring.profiles.active=dev > restaurant-service.log 2>&1 & EOF - fi - EOF + fi From 8949780a757d26489635554d9999f7a880658f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A7=80=EC=B0=AC=EC=9A=B0?= Date: Sun, 25 Aug 2024 20:31:43 +0900 Subject: [PATCH 10/18] =?UTF-8?q?=EC=A0=9C=EB=B0=9C=20=E3=85=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-deploy.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index a2bcc3ee..e5654a47 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -91,38 +91,38 @@ jobs: HOST: ${{ secrets.DEV_EC2_HOST3 }} USER: ${{ secrets.DEV_EC2_USER }} run: | - if [[ "${{ steps.check_changes.outputs.cache }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.cache }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/cache-service/build/libs/*.jar ${USER}@${HOST}:~/cache-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar cache-service.jar' || true nohup java -jar cache-service.jar --spring.profiles.active=dev > cache-service.log 2>&1 & - EOF + EOF fi - if [[ "${{ steps.check_changes.outputs.advertisement }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.advertisement }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/advertisement-service/build/libs/*.jar ${USER}@${HOST}:~/advertisement-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar advertisement-service.jar' || true nohup java -jar advertisement-service.jar --spring.profiles.active=dev > advertisement-service.log 2>&1 & - EOF + EOF fi - if [[ "${{ steps.check_changes.outputs.coupon }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.coupon }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/coupon-service/build/libs/*.jar ${USER}@${HOST}:~/coupon-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar coupon-service.jar' || true nohup java -jar coupon-service.jar --spring.profiles.active=dev > coupon-service.log 2>&1 & - EOF + EOF fi - if [[ "${{ steps.check_changes.outputs.delivery-time }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.delivery-time }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/delivery-time-service/build/libs/*.jar ${USER}@${HOST}:~/delivery-time-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar delivery-time-service.jar' || true nohup java -jar delivery-time-service.jar --spring.profiles.active=dev > delivery-time-service.log 2>&1 & - EOF + EOF fi - if [[ "${{ steps.check_changes.outputs.restaurant }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.restaurant }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/restaurant-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-service.jar' || true nohup java -jar restaurant-service.jar --spring.profiles.active=dev > restaurant-service.log 2>&1 & - EOF - fi + EOF + fi From 963c3342b757349294024feb5c563f6437e91bb5 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 22:27:44 +0900 Subject: [PATCH 11/18] =?UTF-8?q?[config]=20=EC=88=98=EC=A0=95=EC=9D=B4=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=ED=95=9C=20=EB=AA=A8=EB=93=88=EB=A7=8C=20?= =?UTF-8?q?=EC=9E=AC=EB=B0=B0=ED=8F=AC=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 변경을 감지해 변경된 모듈(경로)의 jar 파일만 다시 배포 --- .github/workflows/dev-deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index e5654a47..08ea2b9f 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -57,7 +57,7 @@ jobs: chmod 600 private_key - name: 가게노출 서비스 배포 - if: steps.check_changes.outputs.restaurant-exposure == 'false' + if: steps.check_changes.outputs.restaurant-exposure == 'true' env: HOST: ${{ secrets.DEV_EC2_HOST1 }} USER: ${{ secrets.DEV_EC2_USER }} @@ -69,7 +69,7 @@ jobs: EOF - name: 검색 서비스 배포 - if: steps.check_changes.outputs.search == 'false' + if: steps.check_changes.outputs.search == 'true' env: HOST: ${{ secrets.DEV_EC2_HOST2 }} USER: ${{ secrets.DEV_EC2_USER }} @@ -82,11 +82,11 @@ jobs: - name: 기타 서비스 배포 if: | - steps.check_changes.outputs.cache == 'false' || - steps.check_changes.outputs.advertisement == 'false' || - steps.check_changes.outputs.coupon == 'false' || - steps.check_changes.outputs.delivery-time == 'false' || - steps.check_changes.outputs.restaurant == 'false' + steps.check_changes.outputs.cache == 'true' || + steps.check_changes.outputs.advertisement == 'true' || + steps.check_changes.outputs.coupon == 'true' || + steps.check_changes.outputs.delivery-time == 'true' || + steps.check_changes.outputs.restaurant == 'true' env: HOST: ${{ secrets.DEV_EC2_HOST3 }} USER: ${{ secrets.DEV_EC2_USER }} From 4b8408865b0db0b40e53cfe3790039ff584d3f4f Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Sun, 25 Aug 2024 22:28:34 +0900 Subject: [PATCH 12/18] =?UTF-8?q?[config]=20application.yml=20dev=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=9E=AC=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 민감한 프로퍼티를 환경변수로부터 주입하도록 추가 --- .../src/main/resources/application.yml | 18 +++++++---- .../src/main/resources/application.yml | 32 +++++++++---------- .../src/main/resources/application.yml | 22 ++----------- .../src/main/resources/application.yml | 19 ++--------- 4 files changed, 32 insertions(+), 59 deletions(-) diff --git a/service/cache-service/src/main/resources/application.yml b/service/cache-service/src/main/resources/application.yml index 936482ab..158ce1c8 100644 --- a/service/cache-service/src/main/resources/application.yml +++ b/service/cache-service/src/main/resources/application.yml @@ -27,6 +27,7 @@ spring: redis: host: localhost port: 6379 + external-api: cache-service: endpoints: http://localhost:7001/api/v1/cache @@ -43,13 +44,18 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver jpa: database-platform: org.hibernate.dialect.MySQLDialect - show-sql: true - properties: - hibernate: - format_sql: true - hibernate: - ddl-auto: none + data: + redis: + host: ${REDIS_HOST} + port: ${REDIS_PORT} + password: ${REDIS_PASSWORD} + +external-api: + cache-service: + endpoints: ${CACHE_SERVICE_ENDPOINT} + --- + spring: config: activate: diff --git a/service/restaurant-exposure-service/src/main/resources/application.yml b/service/restaurant-exposure-service/src/main/resources/application.yml index d63c92a5..2eb5c08c 100644 --- a/service/restaurant-exposure-service/src/main/resources/application.yml +++ b/service/restaurant-exposure-service/src/main/resources/application.yml @@ -24,18 +24,6 @@ spring: hibernate: ddl-auto: none - elasticsearch: - uris: http://localhost:9200 - username: elastic - password: your_elastic_password - data: - elasticsearch: - repositories: - enabled: true - redis: - host: localhost - port: 6379 - logging: level: tracer: TRACE @@ -66,13 +54,25 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver jpa: database-platform: org.hibernate.dialect.MySQLDialect - show-sql: true - properties: - hibernate: - format_sql: true hibernate: ddl-auto: none + +external-api: + advertisement-service: + endpoints: ${ADVERTISEMENT-SERVICE_SERVICE_ENDPOINT} + coupon-service: + endpoints: ${COUPON-SERVICE_SERVICE_ENDPOINT} + delivery-service: + endpoints: ${DELIVERY-SERVICE_SERVICE_ENDPOINT} + cache-service: + endpoints: ${CACHE-SERVICE_SERVICE_ENDPOINT} + restaurant-service: + endpoints: ${RESTAURANT-SERVICE_SERVICE_ENDPOINT} + search-service: + endpoints: ${SEARCH-SERVICE_SERVICE_ENDPOINT} + --- + spring: config: activate: diff --git a/service/restaurant-service/src/main/resources/application.yml b/service/restaurant-service/src/main/resources/application.yml index 20aefa30..18361b9d 100644 --- a/service/restaurant-service/src/main/resources/application.yml +++ b/service/restaurant-service/src/main/resources/application.yml @@ -24,22 +24,6 @@ spring: hibernate: ddl-auto: none - elasticsearch: - uris: http://localhost:9200 - username: elastic - password: your_elastic_password - data: - elasticsearch: - repositories: - enabled: true - redis: - host: localhost - port: 6379 - -logging: - level: - tracer: TRACE - --- spring: config: @@ -52,13 +36,11 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver jpa: database-platform: org.hibernate.dialect.MySQLDialect - show-sql: true - properties: - hibernate: - format_sql: true hibernate: ddl-auto: none + --- + spring: config: activate: diff --git a/service/search-service/src/main/resources/application.yml b/service/search-service/src/main/resources/application.yml index 52ff71a3..8d7f7e35 100644 --- a/service/search-service/src/main/resources/application.yml +++ b/service/search-service/src/main/resources/application.yml @@ -24,18 +24,10 @@ spring: format_sql: true hibernate: ddl-auto: none - elasticsearch: uris: http://localhost:9200 username: elastic password: your_elastic_password - data: - elasticsearch: - repositories: - enabled: true - redis: - host: localhost - port: 6379 logging: level: @@ -62,17 +54,10 @@ spring: uris: ${ELASTICSEARCH_URL} username: ${ELASTICSEARCH_USERNAME} password: ${ELASTICSEARCH_PASSWORD} - data: - redis: - password: ${REDIS_PASSWORD} external-api: - advertisement-service: - endpoints: http://localhost:8083/api/v1/advertisements - coupon-service: - endpoints: http://localhost:8082/api/v1/coupons - delivery-service: - endpoints: http://localhost:8081/api/v1/deliveries + search-service: + endpoints: ${SEARCH_SERVICE_ENDPOINT} --- From 6c788d67e3813b0b40c3cabcc1847192d123bf0b Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Mon, 26 Aug 2024 00:03:20 +0900 Subject: [PATCH 13/18] =?UTF-8?q?[fix]=20=EC=98=A4=ED=83=88=EC=9E=90=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 가게 노출 서비스 application.yml에 환경변수 이름 오탈자 수정 --- .../src/main/resources/application.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/service/restaurant-exposure-service/src/main/resources/application.yml b/service/restaurant-exposure-service/src/main/resources/application.yml index 2eb5c08c..5abf3602 100644 --- a/service/restaurant-exposure-service/src/main/resources/application.yml +++ b/service/restaurant-exposure-service/src/main/resources/application.yml @@ -59,17 +59,17 @@ spring: external-api: advertisement-service: - endpoints: ${ADVERTISEMENT-SERVICE_SERVICE_ENDPOINT} + endpoints: ${ADVERTISEMENT_SERVICE_ENDPOINT} coupon-service: - endpoints: ${COUPON-SERVICE_SERVICE_ENDPOINT} + endpoints: ${COUPON_SERVICE_ENDPOINT} delivery-service: - endpoints: ${DELIVERY-SERVICE_SERVICE_ENDPOINT} + endpoints: ${DELIVERY_SERVICE_ENDPOINT} cache-service: - endpoints: ${CACHE-SERVICE_SERVICE_ENDPOINT} + endpoints: ${CACHE_SERVICE_ENDPOINT} restaurant-service: - endpoints: ${RESTAURANT-SERVICE_SERVICE_ENDPOINT} + endpoints: ${RESTAURANT_SERVICE_ENDPOINT} search-service: - endpoints: ${SEARCH-SERVICE_SERVICE_ENDPOINT} + endpoints: ${SEARCH_SERVICE_ENDPOINT} --- From a2ca408c08494f76f8b8f4732d5382f01d5e2ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A7=80=EC=B0=AC=EC=9A=B0?= Date: Mon, 26 Aug 2024 00:15:28 +0900 Subject: [PATCH 14/18] =?UTF-8?q?[fix]=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=EA=B0=80=20=EC=A0=81=EC=9A=A9=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit source ~/.bashrc 호출 --- .github/workflows/dev-deploy.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 08ea2b9f..895e2eaf 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -57,7 +57,7 @@ jobs: chmod 600 private_key - name: 가게노출 서비스 배포 - if: steps.check_changes.outputs.restaurant-exposure == 'true' + if: steps.check_changes.outputs.restaurant-exposure == 'false' env: HOST: ${{ secrets.DEV_EC2_HOST1 }} USER: ${{ secrets.DEV_EC2_USER }} @@ -65,11 +65,13 @@ jobs: scp -o StrictHostKeyChecking=no -i private_key service/restaurant-exposure-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-exposure-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-exposure-service.jar' || true + rm -rf estaurant-exposure-service.log + source ~/.bashrc nohup java -jar restaurant-exposure-service.jar --spring.profiles.active=dev > restaurant-exposure-service.log 2>&1 & EOF - name: 검색 서비스 배포 - if: steps.check_changes.outputs.search == 'true' + if: steps.check_changes.outputs.search == 'false' env: HOST: ${{ secrets.DEV_EC2_HOST2 }} USER: ${{ secrets.DEV_EC2_USER }} @@ -77,12 +79,14 @@ jobs: scp -o StrictHostKeyChecking=no -i private_key service/search-service/build/libs/*.jar ${USER}@${HOST}:~/search-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar search-service.jar' || true + rm -rf search-service.log + source ~/.bashrc nohup java -jar search-service.jar --spring.profiles.active=dev > search-service.log 2>&1 & EOF - name: 기타 서비스 배포 if: | - steps.check_changes.outputs.cache == 'true' || + steps.check_changes.outputs.cache == 'false' || steps.check_changes.outputs.advertisement == 'true' || steps.check_changes.outputs.coupon == 'true' || steps.check_changes.outputs.delivery-time == 'true' || @@ -91,38 +95,48 @@ jobs: HOST: ${{ secrets.DEV_EC2_HOST3 }} USER: ${{ secrets.DEV_EC2_USER }} run: | - if [[ "${{ steps.check_changes.outputs.cache }}" == 'true' ]]; then + if [[ "${{ steps.check_changes.outputs.cache }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/cache-service/build/libs/*.jar ${USER}@${HOST}:~/cache-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar cache-service.jar' || true + rm -rf cache-service.log + source ~/.bashrc nohup java -jar cache-service.jar --spring.profiles.active=dev > cache-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.advertisement }}" == 'true' ]]; then + if [[ "${{ steps.check_changes.outputs.advertisement }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/advertisement-service/build/libs/*.jar ${USER}@${HOST}:~/advertisement-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar advertisement-service.jar' || true + rm -rf advertisement-service.log + source ~/.bashrc nohup java -jar advertisement-service.jar --spring.profiles.active=dev > advertisement-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.coupon }}" == 'true' ]]; then + if [[ "${{ steps.check_changes.outputs.coupon }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/coupon-service/build/libs/*.jar ${USER}@${HOST}:~/coupon-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar coupon-service.jar' || true + rm -rf coupon-service.log + source ~/.bashrc nohup java -jar coupon-service.jar --spring.profiles.active=dev > coupon-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.delivery-time }}" == 'true' ]]; then + if [[ "${{ steps.check_changes.outputs.delivery-time }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/delivery-time-service/build/libs/*.jar ${USER}@${HOST}:~/delivery-time-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar delivery-time-service.jar' || true + rm -rf delivery-time-service.log + source ~/.bashrc nohup java -jar delivery-time-service.jar --spring.profiles.active=dev > delivery-time-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.restaurant }}" == 'true' ]]; then + if [[ "${{ steps.check_changes.outputs.restaurant }}" == 'false' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/restaurant-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-service.jar' || true + rm -rf restaurant-service.log + source ~/.bashrc nohup java -jar restaurant-service.jar --spring.profiles.active=dev > restaurant-service.log 2>&1 & EOF fi From 6281fd7e1c3e9e8f34e1e67d239abeffa0e509e0 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Mon, 26 Aug 2024 00:23:40 +0900 Subject: [PATCH 15/18] =?UTF-8?q?[refactor]=20=EC=BF=A0=ED=8F=B0=20?= =?UTF-8?q?=EC=84=9C=EB=B9=84=EC=8A=A4=20bootJar=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - :service:coupon-service 모듈 build.gradle에 booJar.enabled = true 추가 --- service/coupon-service/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/coupon-service/build.gradle b/service/coupon-service/build.gradle index 264665f3..4e46585e 100644 --- a/service/coupon-service/build.gradle +++ b/service/coupon-service/build.gradle @@ -23,6 +23,9 @@ repositories { mavenCentral() } +bootJar.enabled = true +jar.enabled = false + dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' From 91607a4fd58e2dbb64daf89e815c4e98f0c2e544 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Mon, 26 Aug 2024 00:24:47 +0900 Subject: [PATCH 16/18] =?UTF-8?q?[config]=20GitHub=20Actions=20workflow=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 변경된 서비스에 대해서만 배포 --- .github/workflows/dev-deploy.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 895e2eaf..8923dac4 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -57,7 +57,7 @@ jobs: chmod 600 private_key - name: 가게노출 서비스 배포 - if: steps.check_changes.outputs.restaurant-exposure == 'false' + if: steps.check_changes.outputs.restaurant-exposure == 'true' env: HOST: ${{ secrets.DEV_EC2_HOST1 }} USER: ${{ secrets.DEV_EC2_USER }} @@ -71,7 +71,7 @@ jobs: EOF - name: 검색 서비스 배포 - if: steps.check_changes.outputs.search == 'false' + if: steps.check_changes.outputs.search == 'true' env: HOST: ${{ secrets.DEV_EC2_HOST2 }} USER: ${{ secrets.DEV_EC2_USER }} @@ -86,7 +86,7 @@ jobs: - name: 기타 서비스 배포 if: | - steps.check_changes.outputs.cache == 'false' || + steps.check_changes.outputs.cache == 'true' || steps.check_changes.outputs.advertisement == 'true' || steps.check_changes.outputs.coupon == 'true' || steps.check_changes.outputs.delivery-time == 'true' || @@ -95,7 +95,7 @@ jobs: HOST: ${{ secrets.DEV_EC2_HOST3 }} USER: ${{ secrets.DEV_EC2_USER }} run: | - if [[ "${{ steps.check_changes.outputs.cache }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.cache }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/cache-service/build/libs/*.jar ${USER}@${HOST}:~/cache-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar cache-service.jar' || true @@ -104,7 +104,7 @@ jobs: nohup java -jar cache-service.jar --spring.profiles.active=dev > cache-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.advertisement }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.advertisement }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/advertisement-service/build/libs/*.jar ${USER}@${HOST}:~/advertisement-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar advertisement-service.jar' || true @@ -113,7 +113,7 @@ jobs: nohup java -jar advertisement-service.jar --spring.profiles.active=dev > advertisement-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.coupon }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.coupon }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/coupon-service/build/libs/*.jar ${USER}@${HOST}:~/coupon-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar coupon-service.jar' || true @@ -122,7 +122,7 @@ jobs: nohup java -jar coupon-service.jar --spring.profiles.active=dev > coupon-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.delivery-time }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.delivery-time }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/delivery-time-service/build/libs/*.jar ${USER}@${HOST}:~/delivery-time-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar delivery-time-service.jar' || true @@ -131,7 +131,7 @@ jobs: nohup java -jar delivery-time-service.jar --spring.profiles.active=dev > delivery-time-service.log 2>&1 & EOF fi - if [[ "${{ steps.check_changes.outputs.restaurant }}" == 'false' ]]; then + if [[ "${{ steps.check_changes.outputs.restaurant }}" == 'true' ]]; then scp -o StrictHostKeyChecking=no -i private_key service/restaurant-service/build/libs/*.jar ${USER}@${HOST}:~/restaurant-service.jar ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-service.jar' || true From 506822599d743009d5ca6200dbaa47e8888ebdeb Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Mon, 26 Aug 2024 00:32:18 +0900 Subject: [PATCH 17/18] =?UTF-8?q?[config]=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=ED=8C=8C=EC=9D=BC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bashrc 대신 bash_profile로 변경 --- .github/workflows/dev-deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index 8923dac4..db3d5234 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -66,7 +66,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-exposure-service.jar' || true rm -rf estaurant-exposure-service.log - source ~/.bashrc + source ~/.bash_profile nohup java -jar restaurant-exposure-service.jar --spring.profiles.active=dev > restaurant-exposure-service.log 2>&1 & EOF @@ -80,7 +80,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar search-service.jar' || true rm -rf search-service.log - source ~/.bashrc + source ~/.bash_profile nohup java -jar search-service.jar --spring.profiles.active=dev > search-service.log 2>&1 & EOF @@ -100,7 +100,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar cache-service.jar' || true rm -rf cache-service.log - source ~/.bashrc + source ~/.bash_profile nohup java -jar cache-service.jar --spring.profiles.active=dev > cache-service.log 2>&1 & EOF fi @@ -109,7 +109,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar advertisement-service.jar' || true rm -rf advertisement-service.log - source ~/.bashrc + source ~/.bash_profile nohup java -jar advertisement-service.jar --spring.profiles.active=dev > advertisement-service.log 2>&1 & EOF fi @@ -118,7 +118,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar coupon-service.jar' || true rm -rf coupon-service.log - source ~/.bashrc + source ~/.bash_profile nohup java -jar coupon-service.jar --spring.profiles.active=dev > coupon-service.log 2>&1 & EOF fi @@ -127,7 +127,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar delivery-time-service.jar' || true rm -rf delivery-time-service.log - source ~/.bashrc + source ~/.bash_profile nohup java -jar delivery-time-service.jar --spring.profiles.active=dev > delivery-time-service.log 2>&1 & EOF fi @@ -136,7 +136,7 @@ jobs: ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF pkill -f 'java -jar restaurant-service.jar' || true rm -rf restaurant-service.log - source ~/.bashrc + source ~/.bash_profile nohup java -jar restaurant-service.jar --spring.profiles.active=dev > restaurant-service.log 2>&1 & EOF fi From da542a22da767a825d4d10aaf31c310543366822 Mon Sep 17 00:00:00 2001 From: jcw1031 Date: Mon, 26 Aug 2024 01:30:31 +0900 Subject: [PATCH 18/18] =?UTF-8?q?[config]=20dev=20=EB=B8=8C=EB=9E=9C?= =?UTF-8?q?=EC=B9=98=EC=97=90=20=EB=8C=80=ED=95=B4=EC=84=9C=EB=A7=8C=20?= =?UTF-8?q?=EB=8F=99=EC=9E=91=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dev-deploy.yml b/.github/workflows/dev-deploy.yml index db3d5234..c9e6fbb9 100644 --- a/.github/workflows/dev-deploy.yml +++ b/.github/workflows/dev-deploy.yml @@ -4,7 +4,6 @@ on: push: branches: - dev - - config/122-deploy-script jobs: build-and-deploy: