From 2171cd60a7200b60ccbecaaa5ea35ac88421744e Mon Sep 17 00:00:00 2001 From: michaelpede Date: Tue, 26 Oct 2021 15:36:30 -0700 Subject: [PATCH] Notes and changes for deploying to different environments. --- Dockerfile | 2 +- README.md | 24 ++++++++++++++++++++++++ build.sh | 3 +++ docker/docker-builder | 3 ++- env-default | 3 +-- env-default-windows | 8 ++++++++ 6 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 env-default-windows diff --git a/Dockerfile b/Dockerfile index d539d10..d877905 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM tomcat:9 -#FROM tomcat:latest +#FROM tomcat:latest # latest stopped working, Nov 2021 ENV JPDA_ADDRESS="*:8000" ENV JPDA_TRANSPORT="dt_socket" diff --git a/README.md b/README.md index e7ad40c..0f4db12 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,27 @@ You will need to configure the following environment variables, so the server ca * SQL_HOST * SQL_USER * SQL_PASSWORD + +## ENVIRNONMENT SPECIFIC NOTES + +The build scripts were moved to take place in a Docker container so that they would work consistently across environments. + +### Windows +In Windows, running under a Bash shell will work, assuming you meet the above requirements. +Don't forget to have Docker installed for Windows. + +There is an `env-default-windows` file you should rename to `.env` before running the build script. + +The `docker/docker-builder` file has a line commented out for Windows users. + +### MAC + +This has not been tested. Anyone wanting to give feedback would be appreciated. + +## BUILD FAILURES + +In the case this happens, and you have fixed the source of the error and need to rebuild everything using the build scripts, you should delete any prior Docker containers. + +## Customizing your setup + +You can have your own SQL database. Just copy the `env-default` file to `.env` and modify the appropriate properties. \ No newline at end of file diff --git a/build.sh b/build.sh index d6e4d34..3d880e9 100644 --- a/build.sh +++ b/build.sh @@ -10,6 +10,9 @@ then cp "${HOME_DIR}/env-default" "${HOME_DIR}/.env" fi +#Needed for Linux builds +chmod a+x "${HOME_DIR}/docker/scripts/*" + docker build -t reso-builder -f docker/docker-builder . docker run --name builder --mount type=bind,source="${HOME_DIR}",target=/usr/src/app -t reso-builder diff --git a/docker/docker-builder b/docker/docker-builder index 015f791..efad245 100644 --- a/docker/docker-builder +++ b/docker/docker-builder @@ -4,6 +4,7 @@ WORKDIR /usr/src/app ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y wget openjdk-8-jdk curl pip maven docker-compose -RUN update-java-alternatives -s java-1.8.0-openjdk-amd64 +# Needed for Windows builds +#RUN update-java-alternatives -s java-1.8.0-openjdk-amd64 CMD ./docker/scripts/build.sh diff --git a/env-default b/env-default index 51a5248..bf00b04 100644 --- a/env-default +++ b/env-default @@ -1,8 +1,7 @@ -COMPOSE_FILE=docker-compose.yml;./optional/docker-db-compose.yml +COMPOSE_FILE=docker-compose.yml:./optional/docker-db-compose.yml SQL_HOST=docker-mysql SQL_USER=root SQL_PASSWORD=root SQL_DB_DRIVER=com.mysql.cj.jdbc.Driver SQL_CONNECTION_STR=jdbc:mysql://docker-mysql/reso_data_dictionary_1_7?autoReconnect=true&maxReconnects=4 -#&user=root&password=root CERT_REPORT_FILENAME=RESODataDictionary-1.7.metadata-report.json \ No newline at end of file diff --git a/env-default-windows b/env-default-windows new file mode 100644 index 0000000..3adb772 --- /dev/null +++ b/env-default-windows @@ -0,0 +1,8 @@ +#Composer file needs a specific separator on Windows. +COMPOSE_FILE=docker-compose.yml;./optional/docker-db-compose.yml +SQL_HOST=docker-mysql +SQL_USER=root +SQL_PASSWORD=root +SQL_DB_DRIVER=com.mysql.cj.jdbc.Driver +SQL_CONNECTION_STR=jdbc:mysql://docker-mysql/reso_data_dictionary_1_7?autoReconnect=true&maxReconnects=4 +CERT_REPORT_FILENAME=RESODataDictionary-1.7.metadata-report.json \ No newline at end of file