Skip to content

Commit

Permalink
Merge branch 'main' into PLAT-346-kafak-topic-partitioning
Browse files Browse the repository at this point in the history
  • Loading branch information
tumbledwyer authored Jul 26, 2022
2 parents c81f15e + 27ec7e0 commit 3123910
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions data-mapper-logstash/docker-compose.cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3.9'

services:
data-mapper-logstash:
deploy:
mode: global
11 changes: 10 additions & 1 deletion data-mapper-logstash/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Arguments
ACTION=$1
MODE=$2
STATEFUL_NODES=${STATEFUL_NODES:-"cluster"}

readonly LOGSTASH_DEV_MOUNT=$LOGSTASH_DEV_MOUNT

Expand All @@ -24,6 +25,14 @@ ROOT_PATH="${COMPOSE_FILE_PATH}/.."
. "${ROOT_PATH}/utils/docker-utils.sh"
. "${ROOT_PATH}/utils/log.sh"

if [[ $STATEFUL_NODES == "cluster" ]]; then
log info "Running Data Mapper Logstash package in Cluster node mode"
logstashClusterComposeParam="-c ${COMPOSE_FILE_PATH}/docker-compose.cluster.yml"
else
log info "Running Data Mapper Logstash package in Single node mode"
logstashClusterComposeParam=""
fi

if [[ "$MODE" == "dev" ]]; then
log info "Running Data Mapper Logstash package in DEV mode"
LogstashDevComposeParam="-c ${COMPOSE_FILE_PATH}/docker-compose.dev.yml"
Expand Down Expand Up @@ -52,7 +61,7 @@ if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then
config::generate_service_configs data-mapper-logstash /usr/share/logstash "${COMPOSE_FILE_PATH}/pipeline" "${COMPOSE_FILE_PATH}"
LogstashTempComposeParam="-c ${COMPOSE_FILE_PATH}/docker-compose.tmp.yml"

try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $LogstashDevComposeParam $LogstashDevMountComposeParam $LogstashTempComposeParam instant" "Failed to deploy Data Mapper Logstash"
try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $logstashClusterComposeParam $LogstashDevComposeParam $LogstashDevMountComposeParam $LogstashTempComposeParam instant" "Failed to deploy Data Mapper Logstash"

docker::await_container_startup data-mapper-logstash
docker::await_container_status data-mapper-logstash Running
Expand Down

0 comments on commit 3123910

Please sign in to comment.