From 0d900b1b61f61be6b434aaa879f82279bfdba6a2 Mon Sep 17 00:00:00 2001 From: KIM MINA Date: Sun, 1 Sep 2024 02:10:29 +0900 Subject: [PATCH 01/12] chore: dev-aws-CI-CD.yml --- .github/workflows/dev-aws-CI-CD.yml | 104 ++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/dev-aws-CI-CD.yml diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml new file mode 100644 index 0000000..a96ae92 --- /dev/null +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -0,0 +1,104 @@ +name: dev - CI/CD to Amazon ECS + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Gradle Caching + 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: Grant Execute Permission For Gradlew + run: chmod +x gradlew + + - name: Build With Gradle + run: ./gradlew build -x test + + ## build Test + - name: 테스트 코드 실행 + run: ./gradlew --info test + + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action@v1 + if: ${{ always() }} + with: + files: build/test-results/**/*.xml + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: success() || failure() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml' + + deploy: + name: Deploy + runs-on: ubuntu-latest + + steps: + # 도커 컴포즈 설정 파일 서버로 전달하기(복사 후 붙여넣기) + - name: Send docker-compose.yml + uses: appleboy/scp-action@master + with: + username: ec2-user + host: ${{ secrets.AWS_DEV_HOSTNAME }} + key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} + source: "./docker-compose.yml" + target: "/home/ubuntu/" + + ## nginx 설정 파일 서버로 전달하기(복사 후 붙여넣기) + - name: Send nginx.conf + uses: appleboy/scp-action@master + with: + username: ec2-user + host: ${{ secrets.AWS_DEV_HOSTNAME }} + key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} + source: "./nginx/nginx.conf" + target: "/home/ubuntu/" + + ## springboot 도커 이미지 빌드 후 도커허브에 push하기 + - name: Docker build & Push + env: + JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} + run: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker build -t ${{ secrets.DOCKER_REPOSITORY }} . # 태그를 명시하지 않으면 :latest로 처리됨 + docker push ${{ secrets.DOCKER_REPOSITORY }} + + # 도커 허브에서 jar파일 및 pull후에 컴포즈 up + - name: Deploy to Dev + uses: appleboy/ssh-action@master + with: + username: ec2-user + host: ${{ secrets.AWS_DEV_HOSTNAME }} + key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} + script: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:backend # 백엔드 태그 명시 + sudo cp /home/ubuntu/nginx/nginx.conf /home/ubuntu/src/main/resources/backend-config/nginx/nginx.conf # 위치 확인 필요 + docker-compose down + docker rmi $(docker images -q) + docker-compose up -d From b5d8caf017bae9187e2aa24ba9a423fdd7d3628d Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Sun, 1 Sep 2024 15:00:49 +0900 Subject: [PATCH 02/12] =?UTF-8?q?chore:=20docker=20+=20docker-compose=20+?= =?UTF-8?q?=20github-action=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=ED=86=B5=ED=95=9C=20CI/CD=20=EC=9E=90=EB=8F=99?= =?UTF-8?q?=ED=99=94=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-aws-CI-CD.yml | 199 ++++++++++-------- Dockerfile | 2 +- Dockerfile-nginx | 2 + docker-compose.yml | 29 +++ nginx/conf.d/nginx.conf | 13 ++ .../clothstar/common/config/JasyptConfig.kt | 7 +- 6 files changed, 168 insertions(+), 84 deletions(-) create mode 100644 Dockerfile-nginx create mode 100644 docker-compose.yml create mode 100644 nginx/conf.d/nginx.conf diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index a96ae92..cb118e7 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -12,93 +12,128 @@ permissions: jobs: build: runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event_name == 'pull_request' steps: - - name: checkout - uses: actions/checkout@v3 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - - name: Gradle Caching - 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: Grant Execute Permission For Gradlew - run: chmod +x gradlew - - - name: Build With Gradle - run: ./gradlew build -x test - - ## build Test - - name: 테스트 코드 실행 - run: ./gradlew --info test - - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@v1 - if: ${{ always() }} - with: - files: build/test-results/**/*.xml - - - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 - if: success() || failure() # always run even if the previous step fails - with: - report_paths: '**/build/test-results/test/TEST-*.xml' + - name: checkout + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Gradle Caching + 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: Grant Execute Permission For Gradlew + run: chmod +x gradlew + + - name: Build With Gradle + run: ./gradlew build -x test + + ## build Test + - name: 테스트 코드 실행 + run: ./gradlew --info test + + - name: Publish Unit Test Results + uses: EnricoMi/publish-unit-test-result-action@v1 + if: ${{ always() }} + with: + files: build/test-results/**/*.xml + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: success() || failure() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml' deploy: name: Deploy runs-on: ubuntu-latest + if: github.event_name == 'push' # push일 때만 실행 + needs: build # build 작업이 끝난 후 실행 steps: - # 도커 컴포즈 설정 파일 서버로 전달하기(복사 후 붙여넣기) - - name: Send docker-compose.yml - uses: appleboy/scp-action@master - with: - username: ec2-user - host: ${{ secrets.AWS_DEV_HOSTNAME }} - key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} - source: "./docker-compose.yml" - target: "/home/ubuntu/" - - ## nginx 설정 파일 서버로 전달하기(복사 후 붙여넣기) - - name: Send nginx.conf - uses: appleboy/scp-action@master - with: - username: ec2-user - host: ${{ secrets.AWS_DEV_HOSTNAME }} - key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} - source: "./nginx/nginx.conf" - target: "/home/ubuntu/" - - ## springboot 도커 이미지 빌드 후 도커허브에 push하기 - - name: Docker build & Push - env: - JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} - run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -t ${{ secrets.DOCKER_REPOSITORY }} . # 태그를 명시하지 않으면 :latest로 처리됨 - docker push ${{ secrets.DOCKER_REPOSITORY }} - - # 도커 허브에서 jar파일 및 pull후에 컴포즈 up - - name: Deploy to Dev - uses: appleboy/ssh-action@master - with: - username: ec2-user - host: ${{ secrets.AWS_DEV_HOSTNAME }} - key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} - script: | + # 도커 컴포즈 설정 파일 서버로 전달하기(복사 후 붙여넣기) + - name: Send docker-compose.yml + uses: appleboy/scp-action@master + with: + username: ubuntu + host: ${{ secrets.AWS_DEV_HOSTNAME }} + key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} + source: "./docker-compose.yml" + target: "/home/ubuntu/" + + ## nginx 설정 파일 서버로 전달하기(복사 후 붙여넣기) + - name: Send nginx.conf + uses: appleboy/scp-action@master + with: + username: ubuntu + host: ${{ secrets.AWS_DEV_HOSTNAME }} + key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} + source: "./nginx/nginx.conf" + target: "/home/ubuntu/" + + ## springboot 도커 이미지 빌드 후 도커허브에 push하기 + - name: Docker build & Push + env: + JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} + run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:backend # 백엔드 태그 명시 - sudo cp /home/ubuntu/nginx/nginx.conf /home/ubuntu/src/main/resources/backend-config/nginx/nginx.conf # 위치 확인 필요 - docker-compose down - docker rmi $(docker images -q) - docker-compose up -d + docker build -t ${{ secrets.DOCKER_REPOSITORY }} . # 태그를 명시하지 않으면 :latest로 처리됨 + docker push ${{ secrets.DOCKER_REPOSITORY }} + + # 도커 허브에서 jar파일 및 pull후에 컴포즈 up + - name: Deploy to Dev + uses: appleboy/ssh-action@master + with: + username: ubuntu + host: ${{ secrets.AWS_DEV_HOSTNAME }} + key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} + script: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }} + sudo cp /home/ubuntu/nginx/nginx.conf /home/ubuntu/src/main/resources/backend-config/nginx/nginx.conf + # 기존 Docker 컨테이너와 이미지를 정리 + docker-compose -f /home/ubuntu/docker-compose.yml down + docker rmi $(docker images -q) + # 새로운 Docker Compose 실행 + docker-compose -f /home/ubuntu/docker-compose.yml up -d + + discord-notify: + name: Discord Notify + runs-on: ubuntu-latest + needs: [ build, deploy ] # build와 deploy 작업이 끝난 후 실행 + steps: + - name: Send Discord Notification + uses: sarisia/actions-status-discord@v1 + if: always() # 항상 실행되도록 설정 + with: + webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} + status: ${{ job.status }} # 현재 작업(job)의 상태 (성공, 실패 등) + title: "CI/CD Pipeline Status" + description: | + ${{ github.event_name == 'push' && format( + 'The CI/CD pipeline has completed.\n- **Build Job Status**: {0}\n- **Deploy Job Status**: {1}\n- **Branch**: {2}\n- **Commit**: {3}\n- **Author**: {4}', + needs.build.result, + needs.deploy.result, + github.ref, + github.sha, + github.actor + ) || github.event_name == 'pull_request' && format( + 'The Build job for pull request has completed.\n- **Build Job Status**: {0}\n- **Branch**: {1}\n- **Commit**: {2}\n- **Author**: {3}', + needs.build.result, + github.ref, + github.sha, + github.actor + ) }} + url: "https://github.com/sarisia/actions-status-discord" + username: GitHub Actions Bot diff --git a/Dockerfile b/Dockerfile index 8ac9716..b8f88eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,4 +4,4 @@ ARG JAR_FILE=/build/libs/clothstar-0.0.1-SNAPSHOT.jar COPY ${JAR_FILE} app.jar -ENTRYPOINT ["java","-jar","/app.jar"] \ No newline at end of file +ENTRYPOINT ["java","-Dspring.profiles.active=dev","-jar","/app.jar"] \ No newline at end of file diff --git a/Dockerfile-nginx b/Dockerfile-nginx new file mode 100644 index 0000000..2de6e9c --- /dev/null +++ b/Dockerfile-nginx @@ -0,0 +1,2 @@ +FROM nginx +COPY ./nginx/conf.d/nginx.conf /etc/nginx/conf.d \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bebbd08 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,29 @@ +version: '3' + +services: + + application: + container_name: clothstar-springboot-dev + image: ogu1208/clothstar-springboot-dev + environment: + - JASYPT_ENCRYPTOR_PASSWORD=${JASYPT_ENCRYPTOR_PASSWORD} + build: + context: ./ + dockerfile: Dockerfile + ports: + - "8080:8080" + restart: on-failure + networks: + - preon_net + + +# nginx: +# container_name: nginx +# image: jonghuni/preonb-nginx +# ports: +# - 80:80 +# depends_on: +# - application + +networks: + preon_net: { } \ No newline at end of file diff --git a/nginx/conf.d/nginx.conf b/nginx/conf.d/nginx.conf new file mode 100644 index 0000000..624aa2b --- /dev/null +++ b/nginx/conf.d/nginx.conf @@ -0,0 +1,13 @@ +server { + listen 80; + server_name *.compute.amazonaws.com + access_log off; + + location / { + proxy_pass http://clothstar:8080; + proxy_set_header Host $host:$server_port; + proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } +} \ No newline at end of file diff --git a/src/main/kotlin/org/store/clothstar/common/config/JasyptConfig.kt b/src/main/kotlin/org/store/clothstar/common/config/JasyptConfig.kt index 3771191..3643f9a 100644 --- a/src/main/kotlin/org/store/clothstar/common/config/JasyptConfig.kt +++ b/src/main/kotlin/org/store/clothstar/common/config/JasyptConfig.kt @@ -3,14 +3,19 @@ package org.store.clothstar.common.config import org.jasypt.encryption.StringEncryptor import org.jasypt.encryption.pbe.PooledPBEStringEncryptor import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig +import org.springframework.beans.factory.annotation.Value import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @Configuration class JasyptConfig { + + @Value("\${jasypt.encryptor.password}") // 환경 변수 또는 application.yml에서 가져오기 + private lateinit var key: String + @Bean("jasyptStringEncryptor") fun stringEncryptor(): StringEncryptor { - val key = "my_jasypt_key" + val encryptor = PooledPBEStringEncryptor() val config = SimpleStringPBEConfig() From 3810d7759ceb29b631b2867e45b6dfe5ada1da73 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Sun, 1 Sep 2024 15:13:28 +0900 Subject: [PATCH 03/12] =?UTF-8?q?chore:=20=EB=AA=A8=EB=93=A0=20CI/CD=20git?= =?UTF-8?q?hub-action=20task=EC=97=90=20JASYPT=5FENCRYPTOR=5FPASSWORD=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=20=EB=B3=80=EC=88=98=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-aws-CI-CD.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index cb118e7..9a62b8d 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -13,6 +13,8 @@ jobs: build: runs-on: ubuntu-latest if: github.event_name == 'push' || github.event_name == 'pull_request' + env: + JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} steps: - name: checkout uses: actions/checkout@v3 @@ -60,6 +62,8 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' # push일 때만 실행 needs: build # build 작업이 끝난 후 실행 + env: + JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} steps: # 도커 컴포즈 설정 파일 서버로 전달하기(복사 후 붙여넣기) From dce87ac9a88edacad57d26a2a937ea01c8a5a898 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Sun, 1 Sep 2024 15:19:07 +0900 Subject: [PATCH 04/12] =?UTF-8?q?chore:=20jasypt.encryptor.password=20?= =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-aws-CI-CD.yml | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index 9a62b8d..11df81b 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' || github.event_name == 'pull_request' env: - JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} + jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 이름 변경 steps: - name: checkout uses: actions/checkout@v3 @@ -39,7 +39,7 @@ jobs: run: chmod +x gradlew - name: Build With Gradle - run: ./gradlew build -x test + run: ./gradlew build -x test --warning-mode all # 모든 경고를 표시 ## build Test - name: 테스트 코드 실행 @@ -63,8 +63,7 @@ jobs: if: github.event_name == 'push' # push일 때만 실행 needs: build # build 작업이 끝난 후 실행 env: - JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} - + jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 이름 변경 steps: # 도커 컴포즈 설정 파일 서버로 전달하기(복사 후 붙여넣기) - name: Send docker-compose.yml @@ -88,8 +87,6 @@ jobs: ## springboot 도커 이미지 빌드 후 도커허브에 push하기 - name: Docker build & Push - env: - JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} docker build -t ${{ secrets.DOCKER_REPOSITORY }} . # 태그를 명시하지 않으면 :latest로 처리됨 @@ -102,20 +99,22 @@ jobs: username: ubuntu host: ${{ secrets.AWS_DEV_HOSTNAME }} key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} - script: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }} - sudo cp /home/ubuntu/nginx/nginx.conf /home/ubuntu/src/main/resources/backend-config/nginx/nginx.conf - # 기존 Docker 컨테이너와 이미지를 정리 - docker-compose -f /home/ubuntu/docker-compose.yml down - docker rmi $(docker images -q) - # 새로운 Docker Compose 실행 - docker-compose -f /home/ubuntu/docker-compose.yml up -d + script: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }} + sudo cp /home/ubuntu/nginx/nginx.conf /home/ubuntu/src/main/resources/backend-config/nginx/nginx.conf + # 기존 Docker 컨테이너와 이미지를 정리 + docker-compose -f /home/ubuntu/docker-compose.yml down + docker rmi $(docker images -q) + # 새로운 Docker Compose 실행 + docker-compose -f /home/ubuntu/docker-compose.yml up -d discord-notify: name: Discord Notify runs-on: ubuntu-latest needs: [ build, deploy ] # build와 deploy 작업이 끝난 후 실행 + env: + jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 이름 변경 steps: - name: Send Discord Notification uses: sarisia/actions-status-discord@v1 @@ -140,4 +139,4 @@ jobs: github.actor ) }} url: "https://github.com/sarisia/actions-status-discord" - username: GitHub Actions Bot + username: GitHub Actions Bot \ No newline at end of file From 0ea1e421ff68bea7aa3f1b0bb3e67d27221fe906 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Sun, 1 Sep 2024 22:17:07 +0900 Subject: [PATCH 05/12] =?UTF-8?q?chore:=20application.yml=EC=97=90=20Jasyp?= =?UTF-8?q?t=20=ED=99=98=EA=B2=BD=EB=B3=80=EC=88=98=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-aws-CI-CD.yml | 12 +++--------- src/main/resources/application.yml | 1 + 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index 11df81b..901a670 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -113,30 +113,24 @@ jobs: name: Discord Notify runs-on: ubuntu-latest needs: [ build, deploy ] # build와 deploy 작업이 끝난 후 실행 + if: always() # 항상 실행되도록 설정 env: - jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 이름 변경 + jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} steps: - name: Send Discord Notification uses: sarisia/actions-status-discord@v1 - if: always() # 항상 실행되도록 설정 with: webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} status: ${{ job.status }} # 현재 작업(job)의 상태 (성공, 실패 등) title: "CI/CD Pipeline Status" description: | - ${{ github.event_name == 'push' && format( + ${{ format( 'The CI/CD pipeline has completed.\n- **Build Job Status**: {0}\n- **Deploy Job Status**: {1}\n- **Branch**: {2}\n- **Commit**: {3}\n- **Author**: {4}', needs.build.result, needs.deploy.result, github.ref, github.sha, github.actor - ) || github.event_name == 'pull_request' && format( - 'The Build job for pull request has completed.\n- **Build Job Status**: {0}\n- **Branch**: {1}\n- **Commit**: {2}\n- **Author**: {3}', - needs.build.result, - github.ref, - github.sha, - github.actor ) }} url: "https://github.com/sarisia/actions-status-discord" username: GitHub Actions Bot \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e4c716d..cb0c988 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,6 +1,7 @@ jasypt: encryptor: bean: jasyptStringEncryptor + password: ${ JASYPT_ENCRYPTOR_PASSWORD} spring: profiles: From 4100ac07e16004a22a7c70ad77a92b29f430baba Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Thu, 5 Sep 2024 00:10:48 +0900 Subject: [PATCH 06/12] =?UTF-8?q?chore:=20dev-aws-CI-CD.yml=EC=97=90=20env?= =?UTF-8?q?ironment:=20dev=20=ED=99=98=EA=B2=BD=EC=9D=84=20=EB=AA=85?= =?UTF-8?q?=EC=8B=9C=EC=A0=81=EC=9C=BC=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-aws-CI-CD.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index 901a670..026a692 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -12,6 +12,7 @@ permissions: jobs: build: runs-on: ubuntu-latest + environment: dev # 환경을 명시적으로 설정 if: github.event_name == 'push' || github.event_name == 'pull_request' env: jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 이름 변경 @@ -60,6 +61,7 @@ jobs: deploy: name: Deploy runs-on: ubuntu-latest + environment: dev # 환경을 명시적으로 설정 if: github.event_name == 'push' # push일 때만 실행 needs: build # build 작업이 끝난 후 실행 env: @@ -112,6 +114,7 @@ jobs: discord-notify: name: Discord Notify runs-on: ubuntu-latest + environment: dev needs: [ build, deploy ] # build와 deploy 작업이 끝난 후 실행 if: always() # 항상 실행되도록 설정 env: From 1ab41efac1dd69614805ac07044a7b426b4f8f33 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Thu, 5 Sep 2024 00:44:15 +0900 Subject: [PATCH 07/12] =?UTF-8?q?chore:=20Docker=20Image,=20Repository=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=EB=A5=BC=20docker-compose.yml=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AC=EC=9A=A9=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=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-aws-CI-CD.yml | 31 +++++++++++++++++++---------- docker-compose.yml | 7 ++----- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index 026a692..e8ed520 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -15,7 +15,9 @@ jobs: environment: dev # 환경을 명시적으로 설정 if: github.event_name == 'push' || github.event_name == 'pull_request' env: - jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 이름 변경 + jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} + DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} # 환경 변수 설정 + DOCKER_REPOSITORY_NGINX: ${{ secrets.DOCKER_REPOSITORY_NGINX }} # 환경 변수 설정 steps: - name: checkout uses: actions/checkout@v3 @@ -65,7 +67,9 @@ jobs: if: github.event_name == 'push' # push일 때만 실행 needs: build # build 작업이 끝난 후 실행 env: - jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 이름 변경 + JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 환경 변수 설정 + DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} # 환경 변수 설정 + DOCKER_REPOSITORY_NGINX: ${{ secrets.DOCKER_REPOSITORY_NGINX }} # 환경 변수 설정 steps: # 도커 컴포즈 설정 파일 서버로 전달하기(복사 후 붙여넣기) - name: Send docker-compose.yml @@ -87,6 +91,13 @@ jobs: source: "./nginx/nginx.conf" target: "/home/ubuntu/" + ## Nginx 도커 이미지 빌드 후 도커허브에 push하기 + - name: Docker build & Push for Nginx + run: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker build -f dockerfile-nginx -t ${{ secrets.DOCKER_REPOSITORY_NGINX }} . # Nginx용 Dockerfile 사용 + docker push ${{ secrets.DOCKER_REPOSITORY_NGINX }} + ## springboot 도커 이미지 빌드 후 도커허브에 push하기 - name: Docker build & Push run: | @@ -101,20 +112,18 @@ jobs: username: ubuntu host: ${{ secrets.AWS_DEV_HOSTNAME }} key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} - script: | + run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - sudo docker pull ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }} - sudo cp /home/ubuntu/nginx/nginx.conf /home/ubuntu/src/main/resources/backend-config/nginx/nginx.conf - # 기존 Docker 컨테이너와 이미지를 정리 - docker-compose -f /home/ubuntu/docker-compose.yml down - docker rmi $(docker images -q) - # 새로운 Docker Compose 실행 - docker-compose -f /home/ubuntu/docker-compose.yml up -d + export DOCKER_REPOSITORY=${{ secrets.DOCKER_REPOSITORY }} + export DOCKER_REPOSITORY_NGINX=${{ secrets.DOCKER_REPOSITORY_NGINX }} + export JASYPT_ENCRYPTOR_PASSWORD=${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} + sudo docker-compose -f /home/ubuntu/docker-compose.yml down + sudo docker-compose -f /home/ubuntu/docker-compose.yml up -d discord-notify: name: Discord Notify runs-on: ubuntu-latest - environment: dev + environment: dev # 환경을 명시적으로 설정 needs: [ build, deploy ] # build와 deploy 작업이 끝난 후 실행 if: always() # 항상 실행되도록 설정 env: diff --git a/docker-compose.yml b/docker-compose.yml index bebbd08..6689d5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: application: container_name: clothstar-springboot-dev - image: ogu1208/clothstar-springboot-dev + image: ${DOCKER_REPOSITORY}:latest environment: - JASYPT_ENCRYPTOR_PASSWORD=${JASYPT_ENCRYPTOR_PASSWORD} build: @@ -19,11 +19,8 @@ services: # nginx: # container_name: nginx -# image: jonghuni/preonb-nginx +# image: ${DOCKER_REPOSITORY_NGINX}:latest # ports: # - 80:80 # depends_on: # - application - -networks: - preon_net: { } \ No newline at end of file From f2bc9714bd5431a5310b0f38b54ba12475445c23 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Thu, 5 Sep 2024 00:56:19 +0900 Subject: [PATCH 08/12] =?UTF-8?q?chore:=20dev-aws-CI-CD.yml=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 1. Docker Compose Pull 후 Up 실행: - 최신 이미지를 Docker Hub에서 Pull하고, docker-compose up -d --build를 통해 새 컨테이너를 실행합니다. 2. Docker Login 중복 제거: - Docker 로그인은 한 번만 수행하여 중복된 로그인을 제거했습니다. 3. 불필요한 docker-compose down 제거: - 모든 컨테이너와 네트워크를 정리하는 docker-compose down을 제거했습니다. 단순히 컨테이너를 업데이트하려면 docker-compose up으로 충분합니다. --- .github/workflows/dev-aws-CI-CD.yml | 53 +++++++++++++++-------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index e8ed520..26a14b7 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -12,14 +12,14 @@ permissions: jobs: build: runs-on: ubuntu-latest - environment: dev # 환경을 명시적으로 설정 + environment: dev if: github.event_name == 'push' || github.event_name == 'pull_request' env: jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} - DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} # 환경 변수 설정 - DOCKER_REPOSITORY_NGINX: ${{ secrets.DOCKER_REPOSITORY_NGINX }} # 환경 변수 설정 + DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} + DOCKER_REPOSITORY_NGINX: ${{ secrets.DOCKER_REPOSITORY_NGINX }} steps: - - name: checkout + - name: Checkout uses: actions/checkout@v3 - name: Set up JDK 17 @@ -42,9 +42,9 @@ jobs: run: chmod +x gradlew - name: Build With Gradle - run: ./gradlew build -x test --warning-mode all # 모든 경고를 표시 + run: ./gradlew build -x test --warning-mode all - ## build Test + ## Build and test - name: 테스트 코드 실행 run: ./gradlew --info test @@ -56,22 +56,21 @@ jobs: - name: Publish Test Report uses: mikepenz/action-junit-report@v3 - if: success() || failure() # always run even if the previous step fails + if: success() || failure() with: report_paths: '**/build/test-results/test/TEST-*.xml' deploy: name: Deploy runs-on: ubuntu-latest - environment: dev # 환경을 명시적으로 설정 - if: github.event_name == 'push' # push일 때만 실행 - needs: build # build 작업이 끝난 후 실행 + environment: dev + if: github.event_name == 'push' + needs: build env: - JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} # 환경 변수 설정 - DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} # 환경 변수 설정 - DOCKER_REPOSITORY_NGINX: ${{ secrets.DOCKER_REPOSITORY_NGINX }} # 환경 변수 설정 + JASYPT_ENCRYPTOR_PASSWORD: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} + DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} + DOCKER_REPOSITORY_NGINX: ${{ secrets.DOCKER_REPOSITORY_NGINX }} steps: - # 도커 컴포즈 설정 파일 서버로 전달하기(복사 후 붙여넣기) - name: Send docker-compose.yml uses: appleboy/scp-action@master with: @@ -81,7 +80,6 @@ jobs: source: "./docker-compose.yml" target: "/home/ubuntu/" - ## nginx 설정 파일 서버로 전달하기(복사 후 붙여넣기) - name: Send nginx.conf uses: appleboy/scp-action@master with: @@ -91,22 +89,25 @@ jobs: source: "./nginx/nginx.conf" target: "/home/ubuntu/" + ## Docker login + - name: Docker Login + run: | + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + ## Nginx 도커 이미지 빌드 후 도커허브에 push하기 - name: Docker build & Push for Nginx run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -f dockerfile-nginx -t ${{ secrets.DOCKER_REPOSITORY_NGINX }} . # Nginx용 Dockerfile 사용 + docker build -f dockerfile-nginx -t ${{ secrets.DOCKER_REPOSITORY_NGINX }} . docker push ${{ secrets.DOCKER_REPOSITORY_NGINX }} - ## springboot 도커 이미지 빌드 후 도커허브에 push하기 - - name: Docker build & Push + ## Spring Boot 도커 이미지 빌드 후 도커허브에 push하기 + - name: Docker build & Push for Spring Boot run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -t ${{ secrets.DOCKER_REPOSITORY }} . # 태그를 명시하지 않으면 :latest로 처리됨 + docker build -t ${{ secrets.DOCKER_REPOSITORY }} . docker push ${{ secrets.DOCKER_REPOSITORY }} - # 도커 허브에서 jar파일 및 pull후에 컴포즈 up - - name: Deploy to Dev + # 도커 허브에서 이미지 Pull 및 Docker Compose로 컨테이너 실행 + - name: Deploy to Dev with Docker Compose uses: appleboy/ssh-action@master with: username: ubuntu @@ -117,8 +118,10 @@ jobs: export DOCKER_REPOSITORY=${{ secrets.DOCKER_REPOSITORY }} export DOCKER_REPOSITORY_NGINX=${{ secrets.DOCKER_REPOSITORY_NGINX }} export JASYPT_ENCRYPTOR_PASSWORD=${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} - sudo docker-compose -f /home/ubuntu/docker-compose.yml down - sudo docker-compose -f /home/ubuntu/docker-compose.yml up -d + # Pull 최신 이미지 + docker-compose -f /home/ubuntu/docker-compose.yml pull + # 새 컨테이너 실행 + docker-compose -f /home/ubuntu/docker-compose.yml up -d --build discord-notify: name: Discord Notify From d6a32b2128939de9e77654dcb54fb8619aec5620 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Thu, 5 Sep 2024 01:28:43 +0900 Subject: [PATCH 09/12] =?UTF-8?q?fix:=20a=20step=20cannot=20have=20both=20?= =?UTF-8?q?the=20uses=20and=20run=20keys=20=EC=97=90=EB=9F=AC=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SSH 액션(uses: appleboy/ssh-action@master)과 script 키를 함께 사용하여, 원격 서버에서 여러 명령어를 순차적으로 실행합니다. - run 키를 별도로 사용할 필요가 없습니다. 1. uses: appleboy/ssh-action@master: appleboy/ssh-action@master 액션을 사용하여 SSH 연결을 설정합니다. 2. script: 아래에 명령어들: SSH 연결이 설정된 후에, script에 지정된 명령어들이 원격 서버에서 순서대로 실행됩니다. • docker login 명령어를 실행하여 Docker Hub에 로그인합니다. • export 명령어로 필요한 환경 변수를 설정합니다. • docker-compose pull을 실행하여 최신 이미지를 가져옵니다. • docker-compose up -d --build를 실행하여 새 컨테이너를 백그라운드에서 실행합니다. --- .github/workflows/dev-aws-CI-CD.yml | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index 26a14b7..59a95a9 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -106,29 +106,29 @@ jobs: docker build -t ${{ secrets.DOCKER_REPOSITORY }} . docker push ${{ secrets.DOCKER_REPOSITORY }} - # 도커 허브에서 이미지 Pull 및 Docker Compose로 컨테이너 실행 - - name: Deploy to Dev with Docker Compose + # SSH로 서버에 연결 + - name: Connect to Server uses: appleboy/ssh-action@master with: username: ubuntu host: ${{ secrets.AWS_DEV_HOSTNAME }} key: ${{ secrets.AWS_DEV_PRIVATE_KEY }} - run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - export DOCKER_REPOSITORY=${{ secrets.DOCKER_REPOSITORY }} - export DOCKER_REPOSITORY_NGINX=${{ secrets.DOCKER_REPOSITORY_NGINX }} - export JASYPT_ENCRYPTOR_PASSWORD=${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} - # Pull 최신 이미지 - docker-compose -f /home/ubuntu/docker-compose.yml pull - # 새 컨테이너 실행 - docker-compose -f /home/ubuntu/docker-compose.yml up -d --build + script: | # SSH 연결 후 실행할 명령어들 + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + export DOCKER_REPOSITORY=${{ secrets.DOCKER_REPOSITORY }} + export DOCKER_REPOSITORY_NGINX=${{ secrets.DOCKER_REPOSITORY_NGINX }} + export JASYPT_ENCRYPTOR_PASSWORD=${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} + # Pull 최신 이미지 + docker-compose -f /home/ubuntu/docker-compose.yml pull + # 새 컨테이너 실행 + docker-compose -f /home/ubuntu/docker-compose.yml up -d --build discord-notify: name: Discord Notify runs-on: ubuntu-latest - environment: dev # 환경을 명시적으로 설정 - needs: [ build, deploy ] # build와 deploy 작업이 끝난 후 실행 - if: always() # 항상 실행되도록 설정 + environment: dev + needs: [ build, deploy ] + if: always() env: jasypt.encryptor.password: ${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }} steps: @@ -136,7 +136,7 @@ jobs: uses: sarisia/actions-status-discord@v1 with: webhook: ${{ secrets.DISCORD_WEBHOOK_URL }} - status: ${{ job.status }} # 현재 작업(job)의 상태 (성공, 실패 등) + status: ${{ job.status }} title: "CI/CD Pipeline Status" description: | ${{ format( From 7261b15c4f2d1b06f45734760b7aae6c8b50f9e4 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Thu, 5 Sep 2024 01:35:43 +0900 Subject: [PATCH 10/12] =?UTF-8?q?fix:=20Github-Deploy=20Action=EC=97=90?= =?UTF-8?q?=EC=84=9C=20permissions=20=ED=82=A4=EB=A5=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=ED=95=98=EC=97=AC=20checks=EC=97=90=20=EB=8C=80?= =?UTF-8?q?=ED=95=9C=20write=20=EA=B6=8C=ED=95=9C=EC=9D=84=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 EnricoMi/publish-unit-test-result-action에서 발생한 “403 Forbidden” 오류는 GitHub Actions에서 check-runs API 엔드포인트에 접근 권한이 없을 때 발생합니다. 이 문제는 주로 GitHub Actions에서 사용하는 토큰의 권한 문제와 관련이 있습니다. 원인 분석 1. 토큰 권한 부족: GitHub Actions 워크플로우에서 사용하는 GITHUB_TOKEN의 권한이 충분하지 않아서 발생할 수 있습니다. 기본적으로 GITHUB_TOKEN은 read 권한만 부여됩니다. check-runs API는 write 권한이 필요합니다. 2. fork된 저장소에서 실행된 워크플로우: 이 오류는 GitHub Actions가 fork된 저장소에서 실행될 때 발생할 수도 있습니다. fork된 저장소에서는 보안상의 이유로 GitHub Secrets에 접근할 수 없습니다. 해결 방법 1. GITHUB_TOKEN에 write 권한 추가하기: • GITHUB_TOKEN에 write 권한을 추가해야 합니다. 이를 위해 permissions 키를 사용해 checks 권한을 write로 설정해야 합니다. 2. 워크플로우 파일 수정: • 워크플로우 파일에서 permissions 키를 수정하여 checks에 대한 write 권한을 추가합니다. --- .github/workflows/dev-aws-CI-CD.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index 59a95a9..7c25eef 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -8,6 +8,7 @@ on: permissions: contents: read + checks: write jobs: build: From d895ae2349f2ae6a17ace61da85bb29974f86497 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Thu, 5 Sep 2024 01:55:59 +0900 Subject: [PATCH 11/12] =?UTF-8?q?fix:=20=ED=99=98=EA=B2=BD=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=EB=A5=BC=20=20GITHUB=5FENV=EB=A5=BC=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=B4=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev-aws-CI-CD.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index 7c25eef..c50e9ba 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -42,6 +42,9 @@ jobs: - name: Grant Execute Permission For Gradlew run: chmod +x gradlew + - name: Set up Jasypt Encryptor Password + run: echo "JASYPT_ENCRYPTOR_PASSWORD=${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }}" >> $GITHUB_ENV + - name: Build With Gradle run: ./gradlew build -x test --warning-mode all From f4d52daddac53131e05c9d8ddf1398138519fca7 Mon Sep 17 00:00:00 2001 From: Ogu1208 Date: Thu, 5 Sep 2024 02:02:55 +0900 Subject: [PATCH 12/12] =?UTF-8?q?fix:=20=EB=8B=A4=EB=A5=B8=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=EA=B0=92=EB=8F=84=20=ED=99=98=EA=B2=BD=EB=B3=80?= =?UTF-8?q?=EC=88=98=EB=A5=BC=20GITHUB=5FENV=EB=A5=BC=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=B4=20=EC=84=A4=EC=A0=95,=20issues:=20write=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/dev-aws-CI-CD.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-aws-CI-CD.yml b/.github/workflows/dev-aws-CI-CD.yml index c50e9ba..f494caf 100644 --- a/.github/workflows/dev-aws-CI-CD.yml +++ b/.github/workflows/dev-aws-CI-CD.yml @@ -9,6 +9,7 @@ on: permissions: contents: read checks: write + issues: write jobs: build: @@ -42,8 +43,11 @@ jobs: - name: Grant Execute Permission For Gradlew run: chmod +x gradlew - - name: Set up Jasypt Encryptor Password - run: echo "JASYPT_ENCRYPTOR_PASSWORD=${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }}" >> $GITHUB_ENV + - name: Set up Environment Variables + run: | + echo "JASYPT_ENCRYPTOR_PASSWORD=${{ secrets.JASYPT_ENCRYPTOR_PASSWORD }}" >> $GITHUB_ENV + echo "DOCKER_REPOSITORY=${{ secrets.DOCKER_REPOSITORY }}" >> $GITHUB_ENV + echo "DOCKER_REPOSITORY_NGINX=${{ secrets.DOCKER_REPOSITORY_NGINX }}" >> $GITHUB_ENV - name: Build With Gradle run: ./gradlew build -x test --warning-mode all