-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from hzi-braunschweig/dev
Dev
- Loading branch information
Showing
26 changed files
with
54,099 additions
and
1,884 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,75 @@ | ||
# Copyright (c) 2020, Mathew | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright notice, this | ||
# list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright notice, | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
# Copyright (c) 2020, Mathew | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright notice, this | ||
# list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright notice, | ||
# this list of conditions and the following disclaimer in the documentation | ||
# and/or other materials provided with the distribution. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
FROM mirabilia/sormas_fhir_adapter:2-1.0 | ||
#local sormas credentials | ||
ARG SORMAS_ADAPTER_POSTGRES_PASSWORD=password | ||
ARG SORMAS_POSTGRES_USER=sormas_user | ||
ARG SORMAS_SERVER_URL=hzi.mirabilialtd.com | ||
#Adapter Credentials | ||
ARG SORMAS-DHIS2_ADAPTER_POSTGRES_PASSWORD=password | ||
ARG SORMAS-DHIS2_POSTGRES_USER=sormas_user | ||
ARG SORMAS-DHIS2_SERVER_URL=hzi-hl7.mirabilialtd.com | ||
|
||
ARG DOMAIN_NAME=sormas-dhis | ||
ARG DB_NAME=sormas-dhis | ||
|
||
ARG JVM_MAX=2096m | ||
|
||
ARG SORMAS_URL=https://github.com/hzi-braunschweig/SORMAS-DHIS/releases/download/released/sormas_HL7v_dockerized | ||
EXPOSE 6080 | ||
ARG SORMAS-DHIS_VERSION=v2.1.zip | ||
EXPOSE 6048 | ||
|
||
ENV ASENV_PATH="/opt/payara5/glassfish/config/asenv.conf" | ||
RUN useradd payara | ||
|
||
COPY adapter-setup-server.sh /adapter-setup-server.sh | ||
RUN chmod +x /adapter-setup-server.sh | ||
RUN /adapter-setup-server.sh | ||
COPY adapter-start-server.sh /adapter-start-server.sh | ||
RUN chmod +x /adapter-start-server.sh | ||
CMD ["/adapter-start-server.sh"] |
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,88 @@ | ||
|
||
#!/bin/bash | ||
|
||
ROOT_PREFIX= | ||
USER_NAME=payara | ||
|
||
PAYARA_HOME=${ROOT_PREFIX}/opt/payara5 | ||
DOMAINS_HOME=${ROOT_PREFIX}/opt/domains | ||
TEMP_DIR=${ROOT_PREFIX}/opt/${DOMAIN_NAME}/temp | ||
|
||
DEPLOY_PATH=/tmp/${DOMAIN_NAME} | ||
SORMAS2SORMAS_DIR=${ROOT_PREFIX}/opt/sormas2dhis | ||
|
||
DOMAIN_DIR=${DOMAINS_HOME}/${DOMAIN_NAME} | ||
LOG_FILE_PATH=${DOMAIN_DIR}/logs | ||
LOG_FILE_NAME=server_update_`date +"%Y-%m-%d_%H-%M-%S"`.log | ||
|
||
|
||
|
||
mkdir -p ${PAYARA_HOME} | ||
mkdir -p ${DOMAINS_HOME} | ||
mkdir -p ${DEPLOY_PATH} | ||
|
||
mkdir -p ${SORMAS2SORMAS_DIR} | ||
|
||
pushd ${DEPLOY_PATH} | ||
wget ${SORMAS_URL}/${SORMAS-DHIS_VERSION} -O ${DOMAIN_NAME}.zip | ||
unzip ${DOMAIN_NAME}.zip | ||
rm ${DOMAIN_NAME}.zip | ||
popd | ||
|
||
|
||
|
||
# Setting ASADMIN_CALL and creating domain | ||
echo "Creating domain for Payara..." | ||
${PAYARA_HOME}/bin/asadmin create-domain --domaindir ${DOMAINS_HOME} --portbase ${PORT_BASE} --nopassword --template ${PAYARA_HOME}/glassfish/common/templates/gf/production-domain.jar "${DOMAIN_NAME}" | ||
ASADMIN="${PAYARA_HOME}/bin/asadmin --port ${PORT_ADMIN}" | ||
|
||
chown -R ${USER_NAME}:${USER_NAME} ${PAYARA_HOME} | ||
|
||
${PAYARA_HOME}/bin/asadmin start-domain --domaindir ${DOMAINS_HOME} ${DOMAIN_NAME} | ||
|
||
echo "Configuring domain and database connection..." | ||
|
||
# General domain settings | ||
${ASADMIN} delete-jvm-options -Xms2G | ||
${ASADMIN} delete-jvm-options -Xmx2G | ||
${ASADMIN} create-jvm-options -Xmx4096m | ||
|
||
${ASADMIN} set configs.config.server-config.admin-service.das-config.autodeploy-enabled=true | ||
${ASADMIN} set configs.config.server-config.admin-service.das-config.dynamic-reload-enabled=true | ||
|
||
# Set protocol in redirects according to X-Forwarded-Proto (set by reverse proxy) | ||
${ASADMIN} set server.network-config.protocols.protocol.http-listener-1.http.scheme-mapping=X-Forwarded-Proto | ||
|
||
cp ${DEPLOY_PATH}/deploy/sormas.properties ${DOMAIN_DIR} | ||
cp ${DEPLOY_PATH}/deploy/start-payara-sormas.sh ${DOMAIN_DIR} | ||
|
||
chown -R ${USER_NAME}:${USER_NAME} ${DOMAIN_DIR} | ||
|
||
#$GLASSFISH_PATH/bin/asadmin start-domain --domaindir $DOMAIN_PATH $DOMAIN_NAME > $LOG_PATH/$LOG_FILE_NAME | ||
|
||
#sleep 10 | ||
|
||
#echo "Copying apk files..." | ||
#cp ${DEPLOY_PATH}/deploy/android/release/*.apk ${DOWNLOADS_PATH} | ||
|
||
echo "Copying server libs..." | ||
|
||
cp ${DEPLOY_PATH}/deploy/serverlibs/* ${DOMAIN_DIR}/lib/ | ||
|
||
echo "Copying apps..." | ||
|
||
mkdir -p ${DOMAIN_DIR}/deployments | ||
cp ${DEPLOY_PATH}/deploy/apps/*.ear ${DOMAIN_DIR}/deployments/ | ||
cp ${DEPLOY_PATH}/deploy/apps/*.war ${DOMAIN_DIR}/deployments/ | ||
|
||
${PAYARA_HOME}/bin/asadmin stop-domain --domaindir ${DOMAINS_HOME} | ||
|
||
rm -rf ${DOMAIN_DIR}/osgi-cache/* | ||
rm -rf ${DOMAIN_DIR}/applications/* | ||
rm -rf ${DOMAIN_DIR}/generated/* | ||
rm -rf ${DOMAIN_DIR}/logs/* | ||
rm -rf /opt/payara5/mq/javadoc | ||
rm -rf /opt/payara5/mq/examples | ||
rm -rf ${DEPLOY_PATH} | ||
|
||
echo "Server setup completed." |
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 @@ | ||
|
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project-shared-configuration> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project-shared-configuration> | ||
<!-- | ||
This file contains additional configuration written by modules in the NetBeans IDE. | ||
The configuration is intended to be shared among all the users of project and | ||
therefore it is assumed to be part of version control checkout. | ||
Without this configuration present, some functionality in the IDE may be limited or fail altogether. | ||
--> | ||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1"> | ||
--> | ||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1"> | ||
<!-- | ||
Properties that influence various parts of the IDE, especially code formatting and the like. | ||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up. | ||
That way multiple projects can share the same settings (useful for formatting rules for example). | ||
Any value defined here will override the pom.xml file value but is only applicable to the current project. | ||
--> | ||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion> | ||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server> | ||
<netbeans.hint.license>bsd</netbeans.hint.license> | ||
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type> | ||
</properties> | ||
</project-shared-configuration> | ||
--> | ||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion> | ||
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server> | ||
<netbeans.hint.license>bsd</netbeans.hint.license> | ||
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type> | ||
</properties> | ||
</project-shared-configuration> |
Binary file not shown.
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
Oops, something went wrong.