From ec1cd5a5ff11ccd41a2877808e5ed4a34581d175 Mon Sep 17 00:00:00 2001 From: Gyeongho Yang Date: Thu, 5 Dec 2024 15:06:09 +0900 Subject: [PATCH] feat: notice cd error when rollback --- .github/workflows/be-cd.yaml | 4 ++++ .github/workflows/fe-cd.yaml | 6 +++++- backend/src/main/resources/application-prod.yaml | 4 ++-- server/test/check.js | 2 -- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/be-cd.yaml b/.github/workflows/be-cd.yaml index ae2b3d1..6b8f3b9 100644 --- a/.github/workflows/be-cd.yaml +++ b/.github/workflows/be-cd.yaml @@ -70,4 +70,8 @@ jobs: docker service ls | grep -iw ${REPO_NAME}_be \ && docker service update --force ${REPO_NAME}_be \ || docker stack deploy -c docker-compose-be.yaml ${REPO_NAME} + docker image prune -af + if [[ "$status" != "completed" ]]; then + exit 1 + fi diff --git a/.github/workflows/fe-cd.yaml b/.github/workflows/fe-cd.yaml index 0c4f7c6..d294b1c 100644 --- a/.github/workflows/fe-cd.yaml +++ b/.github/workflows/fe-cd.yaml @@ -56,5 +56,9 @@ jobs: REPO_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') docker service ls | grep -iw ${REPO_NAME}_fe \ && docker service update --force ${REPO_NAME}_fe \ - || docker stack deploy -c docker-compose-fe.yaml mapletool + || docker stack deploy -c docker-compose-fe.yaml ${REPO_NAME} + docker image prune -af + if [[ "$status" != "completed" ]]; then + exit 1 + fi diff --git a/backend/src/main/resources/application-prod.yaml b/backend/src/main/resources/application-prod.yaml index 4ff4b17..a91deb5 100644 --- a/backend/src/main/resources/application-prod.yaml +++ b/backend/src/main/resources/application-prod.yaml @@ -1,8 +1,8 @@ spring: - data.redis.host: mem + data.redis.host: mapletool-mem-1 datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://db/maple + url: jdbc:mysql://mapletool-db-1/maple username: root password: ENC(82LhaVLTV7bx76p7M18ES5ceqOWYR8ACDxHfoZEqfgXINYjTOJJBwG00dK6F5Mfx) diff --git a/server/test/check.js b/server/test/check.js index 16cfc88..aa89d3e 100644 --- a/server/test/check.js +++ b/server/test/check.js @@ -14,6 +14,4 @@ export default function () { "is status 200": (r) => r.status === 200, // "response time is less than 1000ms": (r) => r.timings.duration < 1000, }); - - console.log(res.status_text, res.body.length); }