-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b5ff1a
commit 93b6561
Showing
5 changed files
with
150 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: '3.9' | ||
|
||
services: | ||
fhir-ig-importer-mediator: | ||
ports: | ||
- target: 3333 | ||
published: 3333 | ||
mode: host | ||
fhir-ig-importer-ui: | ||
ports: | ||
- target: 8080 | ||
published: 3000 | ||
mode: host | ||
- target: 8081 | ||
published: 3003 | ||
mode: host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3.9' | ||
|
||
services: | ||
fhir-ig-importer-mediator: | ||
image: jembi/fhir-ig-importer-mediator:${FHIR_IG_IMPORTER_CORE_VERSION} | ||
networks: | ||
ig-importer-network: | ||
hapi-fhir: | ||
deploy: | ||
replicas: ${FHIR_IG_IMPORTER_CORE_INSTANCES} | ||
placement: | ||
max_replicas_per_node: 1 | ||
environment: | ||
HAPI_FHIR_BASE_URL: ${HAPI_FHIR_BASE_URL} | ||
HAPI_FHIR_INSTANCES: ${HAPI_FHIR_INSTANCES} | ||
FHIR_IG_IMPORTER_CORE_PORT: ${FHIR_IG_IMPORTER_CORE_PORT} | ||
FHIR_IG_IMPORTER_CORE_HOST: ${FHIR_IG_IMPORTER_CORE_HOST} | ||
|
||
fhir-ig-importer-ui: | ||
image: jembi/fhir-ig-importer-ui:${FHIR_IG_IMPORTER_UI_VERSION} | ||
networks: | ||
ig-importer-network: | ||
hapi-fhir: | ||
deploy: | ||
replicas: ${FHIR_IG_IMPORTER_UI_INSTANCES} | ||
placement: | ||
max_replicas_per_node: 1 | ||
environment: | ||
FHIR_IG_IMPORTER_CORE_URL: ${FHIR_IG_IMPORTER_CORE_URL} | ||
networks: | ||
ig-importer-network: | ||
name: ig-importer-network | ||
hapi-fhir: | ||
name: hapi-fhir_public | ||
external: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"id": "fhir-ig-importer", | ||
"name": "FHIR IG Importer", | ||
"description": "The package provides mechanism of loading a fhir IG and deploying to the fhir server. The package has a microfrontend and mediator app", | ||
"type": "infrastructure", | ||
"version": "0.0.1", | ||
"dependencies": ["interoperability-layer-openhim"], | ||
"environmentVariables": { | ||
"HAPI_FHIR_BASE_URL": "http://localhost:3447/fhir", | ||
"HAPI_FHIR_INSTANCES": 1, | ||
"FHIR_IG_IMPORTER_CORE_PORT": 3333, | ||
"FHIR_IG_IMPORTER_CORE_HOST": "localhost", | ||
"FHIR_IG_IMPORTER_CORE_URL": "http://localhost:3333/fhir/ig/v1.0", | ||
"FHIR_IG_IMPORTER_UI_VERSION": "latest", | ||
"FHIR_IG_IMPORTER_CORE_VERSION": "latest", | ||
"FHIR_IG_IMPORTER_UI_INSTANCES": 1, | ||
"FHIR_IG_IMPORTER_CORE_INSTANCES": 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
|
||
declare ACTION="" | ||
declare MODE="" | ||
declare COMPOSE_FILE_PATH="" | ||
declare UTILS_PATH="" | ||
declare STACK="fhir-ig-importer" | ||
|
||
function init_vars() { | ||
ACTION=$1 | ||
MODE=$2 | ||
|
||
COMPOSE_FILE_PATH=$( | ||
cd "$(dirname "${BASH_SOURCE[0]}")" || exit | ||
pwd -P | ||
) | ||
UTILS_PATH="${COMPOSE_FILE_PATH}/../utils" | ||
readonly ACTION | ||
readonly MODE | ||
readonly COMPOSE_FILE_PATH | ||
readonly UTILS_PATH | ||
readonly STACK | ||
} | ||
# shellcheck disable=SC1091 | ||
function import_sources() { | ||
source "${UTILS_PATH}/docker-utils.sh" | ||
source "${UTILS_PATH}/config-utils.sh" | ||
source "${UTILS_PATH}/log.sh" | ||
} | ||
|
||
function initialize_package() { | ||
local fhir_ig_importer_dev_compose_filename="" | ||
|
||
if [[ "${MODE}" == "dev" ]]; then | ||
log info "Running package in DEV mode" | ||
fhir_ig_importer_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" "$fhir_ig_importer_dev_compose_filename" | ||
) || { | ||
log error "Failed to deploy package" | ||
exit 1 | ||
} | ||
} | ||
|
||
function destroy_package() { | ||
docker::stack_destroy "$STACK" | ||
} | ||
|
||
main() { | ||
init_vars "$@" | ||
import_sources | ||
|
||
if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then | ||
if [[ "${CLUSTERED_MODE}" == "true" ]]; then | ||
log info "Running package in Cluster node mode" | ||
else | ||
log info "Running package in Single node mode" | ||
fi | ||
|
||
initialize_package | ||
elif [[ "${ACTION}" == "down" ]]; then | ||
log info "Scaling down package" | ||
|
||
docker::scale_services "$STACK" 0 | ||
elif [[ "${ACTION}" == "destroy" ]]; then | ||
log info "Destroying package" | ||
destroy_package | ||
else | ||
log error "Valid options are: init, up, down, or destroy" | ||
fi | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters