Skip to content

Commit

Permalink
Add initial service to serve the js bundle for the kafka mapper consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
drizzentic committed Apr 23, 2024
1 parent bdb9304 commit 90b42e8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 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 @@ -21,6 +21,11 @@ services:
networks:
clickhouse:
kafka:

kafka-mapper-consumer-ui:
image: jembi/kafka-mapper-consumer-ui:0.1.0-alpha
networks:
kafka:

configs:
fhir-mapping.json:
Expand All @@ -35,4 +40,4 @@ networks:
external: true
kafka:
name: kafka_public
external: true
external: true
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 90b42e8

Please sign in to comment.