File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
monew-batch/src/main/java/com/monew/monew_batch/article/scheduler Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -154,13 +154,28 @@ jobs:
154154 PORT="${{ matrix.service.port }}"
155155 TASK_DEF="${{ env.NEW_TASK_ARN }}"
156156
157- # Network JSON (public subnets + monew-ecs-sg , public IP)
157+ # Network JSON (public subnets + SGs[] , public IP)
158158 IFS=',' read -r -a SUBNETS <<< "${{ env.PUBLIC_SUBNETS_CSV }}"
159- SUBNET_JSON=$(printf '"%s",' "${SUBNETS[@]}"); SUBNET_JSON="[${SUBNET_JSON%,}]"
159+ SUBNET_JSON=$(printf '"%s",' "${SUBNETS[@]}")
160+ SUBNET_JSON="[${SUBNET_JSON%,}]"
161+
162+ SGS_STR="${{ env.ECS_SERVICE_SG }}" # 예: "sg-aaaa,sg-bbbb"
163+ SG_JSON=$(jq -nc --arg s "$SGS_STR" '$s | split(",")')
164+
160165 NET_JSON=$(jq -nc \
161- --argjson subnets "$SUBNET_JSON" \
162- --arg sg "${{ env.ECS_SERVICE_SG }}" \
163- '{awsvpcConfiguration:{subnets: $subnets, securityGroups: [$sg], assignPublicIp: "ENABLED"}}')
166+ --argjson subnets "$SUBNET_JSON" \
167+ --argjson sgs "$SG_JSON" \
168+ '{
169+ awsvpcConfiguration: {
170+ subnets: $subnets,
171+ securityGroups: $sgs,
172+ assignPublicIp: "ENABLED"
173+ }
174+ }')
175+
176+ echo "Network: $NET_JSON"
177+
178+
164179
165180 LB_JSON=$(jq -nc \
166181 --arg tg "$TG_ARN" --arg cn "$CONTAINER" --argjson cp "$PORT" \
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ public AricleBatchScheduler(
3535 this .yonhapRssJob = yonhapRssJob ;
3636 }
3737
38- // @Scheduled(cron = "0 0 * * * *", zone = "Asia/Seoul")
39- @ Scheduled (fixedRate = 600000 ) // 테스트용
38+ @ Scheduled (cron = "0 0 * * * *" , zone = "Asia/Seoul" )
39+ // @Scheduled(fixedRate = 600000) // 테스트용
4040 public void runJob () throws Exception {
4141 log .info ("🕒 [Batch Scheduler] 뉴스 수집 Job 실행" );
4242
You can’t perform that action at this time.
0 commit comments