Skip to content

Commit

Permalink
Merge pull request #281 from jembi/CU-86byatwn2_Add-Kafka-consumer-ma…
Browse files Browse the repository at this point in the history
…pper-microfrontend-to-platform

Add initial service to serve the js bundle for the kafka mapper consumer
  • Loading branch information
drizzentic authored May 6, 2024
2 parents ac60ac3 + 08fc9fc commit 287b88b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
8 changes: 8 additions & 0 deletions kafka-mapper-consumer/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3.9'

services:
kafka-mapper-consumer-ui:
ports:
- target: 80
published: 8091
mode: host
7 changes: 6 additions & 1 deletion kafka-mapper-consumer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.9'

services:
kafka-mapper-consumer:
image: jembi/kafka-mapper-consumer:0.1.0
image: ${KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION}
environment:
KAFKA_HOST: ${KAFKA_HOST}
KAFKA_PORT: ${KAFKA_PORT}
Expand All @@ -21,6 +21,11 @@ services:
networks:
clickhouse:
kafka:

kafka-mapper-consumer-ui:
image: ${KAFKA_CONSUMER_MAPPER_UI_VERSION}
networks:
kafka:

configs:
fhir-mapping.json:
Expand Down
4 changes: 3 additions & 1 deletion kafka-mapper-consumer/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"OPENHIM_PASSWORD": "instant101",
"REGISTER_MEDIATOR": "true",
"CLICKHOUSE_HOST": "analytics-datastore-clickhouse",
"CLICKHOUSE_PORT": "8123"
"CLICKHOUSE_PORT": "8123",
"KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:0.1.0",
"KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:0.1.0-alpha"
}
}
13 changes: 12 additions & 1 deletion kafka-mapper-consumer/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ declare ACTION=""
declare COMPOSE_FILE_PATH=""
declare UTILS_PATH=""
declare STACK="kafka-mapper"
declare MODE=""

function init_vars() {
ACTION=$1
MODE=$2

COMPOSE_FILE_PATH=$(
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
Expand All @@ -19,6 +21,7 @@ function init_vars() {
readonly COMPOSE_FILE_PATH
readonly UTILS_PATH
readonly STACK
readonly MODE
}

# shellcheck disable=SC1091
Expand All @@ -28,8 +31,16 @@ function import_sources() {
}

function initialize_package() {
local consumer_ui_dev_compose_filename=""

if [[ "${MODE}" == "dev" ]]; then
log info "Running package in DEV mode"
consumer_ui_dev_compose_filename="docker-compose.dev.yml"
else
log info "Running package in PROD mode"
fi
(
docker::deploy_service $STACK "${COMPOSE_FILE_PATH}" "docker-compose.yml"
docker::deploy_service $STACK "${COMPOSE_FILE_PATH}" "docker-compose.yml" "$consumer_ui_dev_compose_filename"
) || {
log error "Failed to deploy package"
exit 1
Expand Down

0 comments on commit 287b88b

Please sign in to comment.