From c9b94985fcfe57c5d01a99a230b50a9aec17d819 Mon Sep 17 00:00:00 2001 From: userjin2123 Date: Thu, 6 Nov 2025 16:17:38 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EA=B8=B0=EC=82=AC=20=EC=88=98?= =?UTF-8?q?=EC=A7=91=20=EC=8A=A4=EC=BC=80=EC=A5=B4=EB=9F=AC=20cron?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD,=20deploy=20=EB=B3=B4?= =?UTF-8?q?=EC=95=88=EA=B7=B8=EB=A3=B9=20=EB=A7=A4=ED=95=91=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/deploy.yml | 25 +++++++++++++++---- .../scheduler/AricleBatchScheduler.java | 4 +-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5a84a38..8a98c72 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -154,13 +154,28 @@ jobs: PORT="${{ matrix.service.port }}" TASK_DEF="${{ env.NEW_TASK_ARN }}" - # Network JSON (public subnets + monew-ecs-sg, public IP) + # Network JSON (public subnets + SGs[], public IP) IFS=',' read -r -a SUBNETS <<< "${{ env.PUBLIC_SUBNETS_CSV }}" - SUBNET_JSON=$(printf '"%s",' "${SUBNETS[@]}"); SUBNET_JSON="[${SUBNET_JSON%,}]" + SUBNET_JSON=$(printf '"%s",' "${SUBNETS[@]}") + SUBNET_JSON="[${SUBNET_JSON%,}]" + + SGS_STR="${{ env.ECS_SERVICE_SG }}" # 예: "sg-aaaa,sg-bbbb" + SG_JSON=$(jq -nc --arg s "$SGS_STR" '$s | split(",")') + NET_JSON=$(jq -nc \ - --argjson subnets "$SUBNET_JSON" \ - --arg sg "${{ env.ECS_SERVICE_SG }}" \ - '{awsvpcConfiguration:{subnets: $subnets, securityGroups: [$sg], assignPublicIp: "ENABLED"}}') + --argjson subnets "$SUBNET_JSON" \ + --argjson sgs "$SG_JSON" \ + '{ + awsvpcConfiguration: { + subnets: $subnets, + securityGroups: $sgs, + assignPublicIp: "ENABLED" + } + }') + + echo "Network: $NET_JSON" + + LB_JSON=$(jq -nc \ --arg tg "$TG_ARN" --arg cn "$CONTAINER" --argjson cp "$PORT" \ diff --git a/monew-batch/src/main/java/com/monew/monew_batch/article/scheduler/AricleBatchScheduler.java b/monew-batch/src/main/java/com/monew/monew_batch/article/scheduler/AricleBatchScheduler.java index 1077cf3..bfc5f3a 100644 --- a/monew-batch/src/main/java/com/monew/monew_batch/article/scheduler/AricleBatchScheduler.java +++ b/monew-batch/src/main/java/com/monew/monew_batch/article/scheduler/AricleBatchScheduler.java @@ -35,8 +35,8 @@ public AricleBatchScheduler( this.yonhapRssJob = yonhapRssJob; } -// @Scheduled(cron = "0 0 * * * *", zone = "Asia/Seoul") - @Scheduled(fixedRate = 600000) // 테스트용 + @Scheduled(cron = "0 0 * * * *", zone = "Asia/Seoul") +// @Scheduled(fixedRate = 600000) // 테스트용 public void runJob() throws Exception { log.info("🕒 [Batch Scheduler] 뉴스 수집 Job 실행");