-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathcopy-server-config.sh
More file actions
executable file
·42 lines (34 loc) · 2 KB
/
copy-server-config.sh
File metadata and controls
executable file
·42 lines (34 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
###############################################################################
# (C) Copyright IBM Corp. 2016, 2022
#
# SPDX-License-Identifier: Apache-2.0
###############################################################################
if [[ -z "${WORKSPACE}" ]]; then
echo "ERROR: WORKSPACE environment variable not set!"
exit 1
fi
echo "Removing the old server config..."
CONFIG="fhir-server/config"
rm -rf ${CONFIG}/* 2> /dev/null
mkdir -p ${CONFIG}
echo "Copying the server config files..."
cp -r ${WORKSPACE}/fhir-server-webapp/src/main/liberty/config/config/* ${CONFIG}/
cp -r ${WORKSPACE}/fhir-server-webapp/src/test/liberty/config/config/* ${CONFIG}/
cp ${CONFIG}/default/fhir-server-config-postgresql-minio.json ${CONFIG}/default/fhir-server-config.json
echo "Replacing datasource content in server configDropins..."
OVERRIDES="fhir-server/configDropins/overrides"
BULKDATA_OVERRIDES="fhir-bulkdata-server/configDropins/overrides"
rm -rf ${OVERRIDES}/* 2> /dev/null
mkdir -p ${OVERRIDES}
echo "Create overrides directory for bulkdata db config..."
rm -rf ${BULKDATA_OVERRIDES}/* 2> /dev/null
mkdir -p ${BULKDATA_OVERRIDES}
# Copy over both the postgres (default_default) and derby (tenant1_*) datasource definitions
cp ${WORKSPACE}/fhir-server-webapp/src/test/liberty/config/configDropins/overrides/datasource-derby.xml ${OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/config/configDropins/disabled/datasource-postgresql.xml ${OVERRIDES}/
echo "Copy over both the postgres (default_default) and derby (tenant1_*) datasource definitions to bulkdata_overrides..."
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/bulkdata/disabled/postgres/datasource-bulkdata.xml ${BULKDATA_OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/test/liberty/config/configDropins/overrides/datasource-derby.xml ${BULKDATA_OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/config/configDropins/disabled/datasource-postgresql.xml ${BULKDATA_OVERRIDES}/
echo "Finished copying the server config."