From 33d19a6cf168c6fbf6d94ec6c608005ebbc28ac2 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 25 Jul 2024 21:24:37 +0900 Subject: [PATCH] fix: deploy aws (#218) * rename bucket name * fix encrypted properties value * fix github actions * fix deploy sh * fix deploy sh * fix deploy sh * fix health check * deploy sh check log * fix jdbc url * fix flyway config * fix jdbc url * fix jdbc url * remove docker compose command * fix flyway config * fix jdbc url * fix jdbc url * fix deploy sh * add hikari maximum pool size * fix s3 bucket source --- module-domain/src/main/resources/application-prod.yml | 11 +++++++---- scripts/deploy.sh | 1 + scripts/health_check.sh | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/module-domain/src/main/resources/application-prod.yml b/module-domain/src/main/resources/application-prod.yml index 526481f..ca30c94 100644 --- a/module-domain/src/main/resources/application-prod.yml +++ b/module-domain/src/main/resources/application-prod.yml @@ -1,6 +1,10 @@ spring: + datasource: + hikari: + maximum-pool-size: 14 + flyway: - url: ENC(J6WzF+M0VMn7+ODxW5FL5nCxGLAAb0idtCItGsn+uHiexwkesIBOcF93WTXBdyrSOq6A8dtJYx2p4ZMT6lfCjL9KtpaCwQxZNf/ChXA9CRIUZcJQJKUepQaLVZ2Ww28pwd9BIpLT0ouYybz+4e/g7ZgyCN6RytW1t3IgLYqoGFYGVMELO1FS26FkpLlM6xMzxxEa4cHzCXhE91wnPhCit3sj8g6d/Zg3MS2JAnJG9PwemDrRGOyvaGZ626zjKRYzXGcFItn5KLT7kbrIePcHsbWXkHZ4++PGVLrt85RbXMk27ZEb0nxNGrUIIfcmSGFy) + url: jdbc:mysql://inspiration-rds-a.cbzl7uckd4zx.ap-northeast-2.rds.amazonaws.com:3306/inspiration?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true user: ENC(jZEdjhanW1BDicsE9g4W205D8n3mIXUiVUchGBakPhNNKx2BB6Ig2SczCQ7P0P3M) password: ENC(wHtJt3OkgAgOD8+3nc1BBuVswm2VozoyOxXBjrANQp69+Jd0ugUSXkO5LkbocVtQ) mail: @@ -13,17 +17,16 @@ cloud: access-key: ENC(TytE6PoRN2G8XiwPq3IU+4GFVHPcNmWXUkYk2MApOEY2a6IZZg0pjew8eXWoa6aWmbUfk/xWWapJee+bucL5Qg==) secret-key: ENC(VvzJa/x/ByNQuonkVRPTWD5zK0EA0YwCBtwhwytxgezkOe95PE6UYMObHiRsKNEmLiH9iIuh1b16M6vy1K3uvSXSa9supz8GR+Kkuz2we5E=) s3: - bucket: ENC(PuGrKff6b61oLzn8MOMis/s+ddimZXme4J8HTemFL4seX6C0y4n44vdXRO2PvcLq0W4nx7cX0Jq7a5ZfQWms6g==) + bucket: ENC(AdrRa6vr8/16pDxF/6sz2ZG0W0jJ4cgAn14lIqana/vQoTl0wSnWnQfdgoTqgSdGSHL1iZE2DvkMzxAn6tX3wg==) logging: file: name: spring.log - ygtang: domain: datasource: - jdbcUrl: ENC(J6WzF+M0VMn7+ODxW5FL5nCxGLAAb0idtCItGsn+uHiexwkesIBOcF93WTXBdyrSOq6A8dtJYx2p4ZMT6lfCjL9KtpaCwQxZNf/ChXA9CRIUZcJQJKUepQaLVZ2Ww28pwd9BIpLT0ouYybz+4e/g7ZgyCN6RytW1t3IgLYqoGFYGVMELO1FS26FkpLlM6xMzxxEa4cHzCXhE91wnPhCit3sj8g6d/Zg3MS2JAnJG9PwemDrRGOyvaGZ626zjKRYzXGcFItn5KLT7kbrIePcHsbWXkHZ4++PGVLrt85RbXMk27ZEb0nxNGrUIIfcmSGFy) + jdbcUrl: jdbc:mysql://inspiration-rds-a.cbzl7uckd4zx.ap-northeast-2.rds.amazonaws.com:3306/inspiration?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true username: ENC(jZEdjhanW1BDicsE9g4W205D8n3mIXUiVUchGBakPhNNKx2BB6Ig2SczCQ7P0P3M) password: ENC(wHtJt3OkgAgOD8+3nc1BBuVswm2VozoyOxXBjrANQp69+Jd0ugUSXkO5LkbocVtQ) driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/scripts/deploy.sh b/scripts/deploy.sh index df485ea..943373f 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -6,6 +6,7 @@ cp ${APP_PATH}/deploy/.env ${APP_PATH}/source/.env export $(cat ${APP_PATH}/source/.env | grep -v ^# | xargs) >/dev/null cd ${SCRIPT_PATH} +chmod +x login_ecr.sh $SCRIPT_PATH/login_ecr.sh ${AWS_CLI_REGION} ${AWS_CLI_ACCOUNT_ID} diff --git a/scripts/health_check.sh b/scripts/health_check.sh index f937e9e..763a21b 100644 --- a/scripts/health_check.sh +++ b/scripts/health_check.sh @@ -6,11 +6,11 @@ APP_PATH=/home/ubuntu/app/inspiration export $(cat ${APP_PATH}/source/.env | grep -v ^# | xargs) >/dev/null -echo "> Start health check of WAS at '${TARGET_URL}:${PORT}' ..." +echo "> Start health check of WAS at '${TARGET_URL}:8080' ..." for RETRY_COUNT in 1 2 3 4 5 6 7 8 9 10; do echo "> #${RETRY_COUNT} trying..." - RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" ${TARGET_URL}:"${PORT}"/health) + RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" ${TARGET_URL}:8080/health) if [ ${RESPONSE_CODE} -eq 200 ]; then echo "> New WAS successfully running"