Some more improvements for deployment

This commit is contained in:
root 2022-05-03 09:16:19 +02:00
parent 8c5e8ed833
commit 63b279617b
5 changed files with 49 additions and 34 deletions

View File

@ -74,13 +74,13 @@ services:
ccp-search-share: ccp-search-share:
image: "ghcr.io/samply/dktk-fed-search-share:main" image: "ghcr.io/samply/dktk-fed-search-share:main"
container_name: bridgehead_ccp_share container_name: bridgehead-ccp-share
environment: environment:
APP_BASE_URL: "http://dktk-fed-search-share:8080" APP_BASE_URL: "http://dktk-fed-search-share:8080"
APP_BROKER_BASEURL: "http://dktk-fed-search.verbis.dkfz.de/broker/rest/searchbroker" APP_BROKER_BASEURL: "http://dktk-fed-search.verbis.dkfz.de/broker/rest/searchbroker"
APP_BROKER_MAIL: "foo@bar.de" APP_BROKER_MAIL: "foo@bar.de"
APP_STORE_BASEURL: "http://bridgehead-dktk-blaze:8080/fhir" APP_STORE_BASEURL: "http://bridgehead-ccp-blaze:8080/fhir"
SPRING_DATASOURCE_URL: "jdbc:postgresql://bridgehead_ccp_share_db:5432/dktk-fed-search-share" SPRING_DATASOURCE_URL: "jdbc:postgresql://bridgehead-ccp-share-db:5432/dktk-fed-search-share"
JAVA_TOOL_OPTIONS: "-Xmx1g" JAVA_TOOL_OPTIONS: "-Xmx1g"
# http_proxy: "http://bridgehead-squid:3128" # http_proxy: "http://bridgehead-squid:3128"
# https_proxy: "http://bridgehead-squid:3128" # https_proxy: "http://bridgehead-squid:3128"
@ -91,14 +91,14 @@ services:
- blaze - blaze
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.dktk-fed-search.rule=PathPrefix(`/dktk-connector`)" - "traefik.http.routers.dktk-fed-search.rule=PathPrefix(`/cpp-connector`)"
- "traefik.http.services.dktk-fed-search.loadbalancer.server.port=8080" - "traefik.http.services.dktk-fed-search.loadbalancer.server.port=8080"
extra_hosts: extra_hosts:
- "dktk-fed-search.verbis.dkfz.de:10.133.193.8" - "dktk-fed-search.verbis.dkfz.de:10.133.193.8"
ccp-search-share-db: ccp-search-share-db:
image: "postgres:14" image: "postgres:14"
container_name: bridgehead_ccp_share_db container_name: bridgehead-ccp-share-db
environment: environment:
POSTGRES_USER: "dktk-fed-search-share" POSTGRES_USER: "dktk-fed-search-share"
POSTGRES_PASSWORD: "dktk-fed-search-share" POSTGRES_PASSWORD: "dktk-fed-search-share"

View File

@ -53,9 +53,6 @@ services:
depends_on: depends_on:
- "gbn-connector-db" - "gbn-connector-db"
restart: "always" restart: "always"
env_file:
###TODO: Move into Image
- internal.env
gbn-connector-db: gbn-connector-db:
image: "postgres:10.17" image: "postgres:10.17"

View File

@ -15,40 +15,42 @@ for prerequisite in $prerequisites; do
# TODO: Check for specific version # TODO: Check for specific version
done done
echo "Checking site.conf" echo "Checking /etc/bridgehead-config/"
## Download submodule
if [ ! -d "/etc/bridgehead-config/" ]; then
echo "Please set up the site-config folder. Instruction are in the readme."
exit 1
else
echo "Done"
fi
echo "Checking /etc/bridgehead-config/site.conf"
#check if site.conf is created #check if site.conf is created
if [ ! -f site.conf ]; then if [ ! -f /etc/bridgehead-config/site.conf ]; then
echo "Please create your specific site.conf file from the site.dev.conf" echo "Please create your specific site.conf file from the site.dev.conf"
exit exit 1
else
echo "Done"
fi fi
#Load site specific variables #Load site specific variables
source site.conf source /etc/bridgehead-config/site.conf
if [ -z "$site_name" ]; then if [ -z "$site_name" ]; then
echo "Please set site_name" echo "Please set site_name"
exit 1
fi fi
echo "Checking site-config module" echo "Checking site-config module"
## Download submodule
if [ ! -d "site-config" ]; then
echo "Please set up the site-config folder. Instruction are in the readme."
exit
else
echo "Site configuration is already loaded"
fi
#Check if a project is selected
if [ -z "$project" ]; then
echo "No project selected! Please add a Project in your local site.conf."
exit
fi
#check if project env is present #check if project env is present
if [ -d "site-config/${project}.env" ]; then if [ -d "/etc/bridgehead-config/${project}.env" ]; then
echo "Please copy the tempalte from ${project} and put it in the site-config folder" echo "Please copy the tempalte from ${project} and put it in the /etc/bridgehead-config/ folder"
exit 1
else
echo "Done"
fi fi
echo "All prerequisites are met!" echo "All prerequisites are met!"

View File

@ -2,22 +2,28 @@
### Note: Currently not complete, needs some features before useable for production ### Note: Currently not complete, needs some features before useable for production
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "No arguments provided" echo "Please provide a Project as argument"
exit 1 exit 1
fi fi
if [ $1 != "ccp" ] && [ $1 != "nngm" ] && [ $1 != "gbn" ]; then
echo "Please provide a supported project like ccp, gbn or nngm"
exit 1
fi
export project=$1
source lib/functions.sh source lib/functions.sh
if ! lib/prerequisites.sh; then if ! lib/prerequisites.sh; then
log "Prerequisites failed, exiting" log "Validating Prerequisites failed, please fix the occurring error"
exit exit 1
fi fi
./lib/generate.sh ./lib/generate.sh
log "Starting bridgehead" log "Starting bridgehead"
# TODO: Check $1 for proper values docker-compose -f $1/docker-compose.yml --env-file /etc/bridgehead-config/$1.env up -d
docker-compose -f $1/docker-compose.yml --env-file bridgehead-config/$1.env up -d
log "The bridgehead should be in online in a few seconds" log "The bridgehead should be in online in a few seconds"

View File

@ -2,7 +2,17 @@
source lib/functions.sh source lib/functions.sh
if [ $# -eq 0 ]; then
echo "Please provide a Project as argument"
exit 1
fi
if [ $1 != "ccp" ] && [$1 != "nngm"] && [ $1 != "gbn" ]; then
echo "Please provide a supported project like ccp, gbn or nngm"
exit 1
fi
log "Stopping bridgehead" log "Stopping bridgehead"
# TODO: Check $1 for proper values # TODO: Check $1 for proper values
docker-compose -f $1/docker-compose.yml --env-file bridgehead-config/$1.env down docker-compose -f $1/docker-compose.yml --env-file /etc/bridgehead-config/$1.env down