diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index 6c8d6094..1dbaa94e 100644 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -32,6 +32,8 @@ mkdir -p $secret_root prlog4j2="${config_root}/prlog4j2.xml" prconfig="${config_root}/prconfig.xml" context_xml="${config_root}/context.xml" +server_xml="${config_root}/server.xml" +web_xml="${config_root}/web.xml" tomcatusers_xml="${config_root}/tomcat-users.xml" db_username_file="${secret_root}/DB_USERNAME" @@ -178,7 +180,6 @@ fi /bin/dockerize -template ${CATALINA_HOME}/conf/Catalina/localhost/${appContextFileName}.xml:${CATALINA_HOME}/conf/Catalina/localhost/${appContextFileName}.xml - # # Copying mounted prlog4j2 file to webapps/prweb/WEB-INF/classes # @@ -199,6 +200,26 @@ else echo "No prconfig was specified in ${prconfig}. Using defaults." fi +# +# Copying mounted server.xml file to conf +# +if [ -e "${server_xml}" ]; then + echo "Loading server.xml from ${server_xml}..."; + cp "${server_xml}" "${CATALINA_HOME}/conf/" +else + echo "No server.xml was specified in ${server_xml}. Using defaults." +fi + +# +# Copying mounted web.xml file to conf +# +if [ -e "${web_xml}" ]; then + echo "Loading web.xml from ${web_xml}..."; + cp "${web_xml}" "${PEGA_DEPLOYMENT_DIR}/WEB-INF/" +else + echo "No web.xml was specified in ${web_xml}. Using defaults." +fi + # # Write config files from templates using dockerize ... # diff --git a/tests/pega-web-ready-testcases.yaml b/tests/pega-web-ready-testcases.yaml index 992a1f2d..a9aa4c68 100755 --- a/tests/pega-web-ready-testcases.yaml +++ b/tests/pega-web-ready-testcases.yaml @@ -935,6 +935,54 @@ commandTests: exitCode: 0 expectedOutput: ["Loading prlog4j2 from /opt/pega/config/prlog4j2.xml"] + # Verify test case for mounted server.xml + - name: "Mounted server.xml" + envVars: + - key: "JDBC_URL" + value: "jdbc:postgresql://localhost:5432/pegadb" + - key: "JDBC_CLASS" + value: "org.postgresql.Driver" + - key: "DB_USERNAME" + value: "postgres" + - key: "DB_PASSWORD" + value: "postgres" + - key: "RULES_SCHEMA" + value: "rules" + - key: "DATA_SCHEMA" + value: "data" + command: "bash" + args: + - -c + - | + mv /tests/test-artifacts/server.xml /opt/pega/config/server.xml && + bash -c './scripts/docker-entrypoint.sh' + exitCode: 0 + expectedOutput: ["Loading server.xml from /opt/pega/config/server.xml"] + + # Verify test case for mounted web.xml + - name: "Mounted web.xml" + envVars: + - key: "JDBC_URL" + value: "jdbc:postgresql://localhost:5432/pegadb" + - key: "JDBC_CLASS" + value: "org.postgresql.Driver" + - key: "DB_USERNAME" + value: "postgres" + - key: "DB_PASSWORD" + value: "postgres" + - key: "RULES_SCHEMA" + value: "rules" + - key: "DATA_SCHEMA" + value: "data" + command: "bash" + args: + - -c + - | + mv /tests/test-artifacts/web.xml /opt/pega/config/web.xml && + bash -c './scripts/docker-entrypoint.sh' + exitCode: 0 + expectedOutput: ["Loading web.xml from /opt/pega/config/web.xml"] + # Hazelcast Username as file input - name: "Hazelcast Username as file input" envVars: @@ -1048,4 +1096,4 @@ commandTests: - -c - | bash -c './scripts/docker-entrypoint.sh' - expectedOutput: ["No context.xml was specified"] \ No newline at end of file + expectedOutput: ["No context.xml was specified"] diff --git a/tests/test-artifacts/server.xml b/tests/test-artifacts/server.xml new file mode 100644 index 00000000..03c18100 --- /dev/null +++ b/tests/test-artifacts/server.xml @@ -0,0 +1 @@ +mounted server.xml diff --git a/tests/test-artifacts/web.xml b/tests/test-artifacts/web.xml new file mode 100644 index 00000000..e0093401 --- /dev/null +++ b/tests/test-artifacts/web.xml @@ -0,0 +1 @@ +mounted web.xml