Skip to content

Commit

Permalink
chore: cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
dlrkdus committed Jan 3, 2025
1 parent 1cf2e77 commit 9f9e6ea
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
7 changes: 0 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ services:
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_NUM_PARTITIONS: 3
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M"
volumes:
- ./scripts:/scripts # 스크립트 경로 연결
command: >
sh -c "
/etc/confluent/docker/run &
sleep 5 && bash /scripts/create-topic.sh
"

spring-app:
image: 084828566517.dkr.ecr.ap-northeast-2.amazonaws.com/somparty:latest
Expand Down
38 changes: 19 additions & 19 deletions scripts/create-topic.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

KAFKA_BROKER="kafka:9092"
TOPIC="chat-topic"

# Kafka가 응답하는지 확인하기 위한 반복문
until docker exec kafka kafka-topics.sh --list --bootstrap-server $KAFKA_BROKER; do
echo "Waiting for Kafka to be ready..."
sleep 5
done

# Kafka가 준비되었으면, 토픽 생성
docker exec kafka kafka-topics.sh --create \
--bootstrap-server $KAFKA_BROKER \
--replication-factor 1 \
--partitions 3 \
--topic $TOPIC

echo "Topic '$TOPIC' created."
##!/bin/bash
#
#KAFKA_BROKER="kafka:9092"
#TOPIC="chat-topic"
#
## Kafka가 응답하는지 확인하기 위한 반복문
#until docker exec kafka kafka-topics.sh --list --bootstrap-server $KAFKA_BROKER; do
# echo "Waiting for Kafka to be ready..."
# sleep 5
#done
#
## Kafka가 준비되었으면, 토픽 생성
#docker exec kafka kafka-topics.sh --create \
# --bootstrap-server $KAFKA_BROKER \
# --replication-factor 1 \
# --partitions 3 \
# --topic $TOPIC
#
#echo "Topic '$TOPIC' created."

0 comments on commit 9f9e6ea

Please sign in to comment.