This is an automated email from the ASF dual-hosted git repository. gk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/turbine-archetypes.git
commit a039857d9926c768d1076cba2a9a1dcfd1212fb5 Author: gemkall <[email protected]> AuthorDate: Tue Aug 3 16:48:45 2021 +0200 update docs --- .../archetype-resources/docs/DOCKER-README.md | 60 +++++++++++++++++++--- .../resources/archetype-resources/docs/README.md | 6 +-- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/main/resources/archetype-resources/docs/DOCKER-README.md b/src/main/resources/archetype-resources/docs/DOCKER-README.md index 8c67a37..dba2129 100644 --- a/src/main/resources/archetype-resources/docs/DOCKER-README.md +++ b/src/main/resources/archetype-resources/docs/DOCKER-README.md @@ -143,9 +143,10 @@ If not yet done, build on the host with mvn clean install -f ../pom.xml -Pdocker ## Debugging Services: Db, App ### Db Service -``` -docker-compose run --rm db /bin/sh -``` + + + docker-compose run --rm db /bin/sh + Extract data in db service mysql -u root -h db -P 3306 -p @@ -157,19 +158,59 @@ Extract data in db service ### App Service -This will start app and db (as it depends on app): +This will start app (and db as app depends on db): docker-compose run --rm app /bin/sh In the container, check: ls -la /myapp // should list pom.xml ... + +## Tests + +The security test is skipped by default as it requires a running mysql. It tests many of the Fulcrum Torque Turbine security aspects, +you may activate it by calling in the root of the container in the shell (e.g. with docker-compose run --rm app /bin/sh): + + mvn test -DskipTests=false + +- You may reset MAVEN_OPTS, which is by default set in settings.xml + + export MAVEN_OPTS= + + +### Prerequisites + +- a running docker service db + +- proper settings of Db connection URL. Check/update + <project-path>/src/test/conf/torque/TorqueTest.properties + + If you have not initialized docker, when creating the archetype instance, + you may have to edit TorqueTest.properties and adapt the url from localhost to db. + + That is, if running tests inside container, set in TorqueTest.properties should be: + + torque.dsfactory.turbine.connection.url = + jdbc:mysql://db:3306/turbine?serverTimeZone=UTC + + On the other side, if running the tests outside the container + the setting should be : + + torque.dsfactory.turbine.connection.url = + jdbc:mysql://localhost:13306/turbine?serverTimeZone=UTC + + This depends of course on the db ports settings in docker-compose.yml. + # System Specific Informations ## Windows +- Start Docker Desktop, you might not get an error immediately if not, but only when shared volumes are created (like + + Error response from daemon: error while creating mount source path '/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/..': mkdir /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/.. file exists + ### Powershell - You may have to replace in volume mapping for host repo path (maven localRepository) backslashes with slashes "/" in docker-compose.yml. @@ -179,9 +220,10 @@ In the container, check: - If a image download fails, try Docker->Network->Update DNS to 8.8.8.8 - ERROR, when starting docker-compose up/start: - "for db Cannot start service db: driver failed programming external connectivity on endpoint docker-resources_db_1 or -ERROR: for docker-resources_db_1 Cannot start service db: driver failed programming external connectivity on endpoint docker-resources_db_1 ... -Error starting userland proxy: mkdir /port/tcp:0.0.0.0:13306:tcp:...:3306: input/output error" + + for db Cannot start service db: driver failed programming external connectivity on endpoint docker-resources_db_1 or + ERROR: for docker-resources_db_1 Cannot start service db: driver failed programming external connectivity on endpoint docker-resources_db_1 ... + Error starting userland proxy: mkdir /port/tcp:0.0.0.0:13306:tcp:...:3306: input/output error" - Check if containers not already running. - Remove containers (if any): docker rm $(docker ps -a -q) @@ -191,7 +233,9 @@ Error starting userland proxy: mkdir /port/tcp:0.0.0.0:13306:tcp:...:3306: input - Check file permissions of archetype generated files (chmod -R a+rw docker-resources, chmod -R a+rw src . -- https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly +- If you generated the project with windows shell, but run the docker form wsl you have to regenerate docker-compose.yml with unix pathes running this command again + + mvn install -Pdocker ### More Internals, Helpful Docker commands diff --git a/src/main/resources/archetype-resources/docs/README.md b/src/main/resources/archetype-resources/docs/README.md index d215d6e..c982b92 100644 --- a/src/main/resources/archetype-resources/docs/README.md +++ b/src/main/resources/archetype-resources/docs/README.md @@ -75,7 +75,7 @@ N.B. Set docker variable to true to enable Docker setup in building the artifact -Ddocker=true -to immediately enable docker setup, when generating the archetype. +to immediately enable docker setup, when generating the archetype. If Currently only port 3306 is supported, if you do not want ot change the port seetings for the db container in docker-compose.yml @@ -161,7 +161,7 @@ action.login=LoginUser in TurbineResources.properties and changing Login.vm appr Prerequisites - ignored tests require at least Turbine version 4.0.1 - database was build successfully e.g. with archetype. -- running mysql +- running mysql or docker service db If running from integration test, check/update - in pom.xml turbine.core property, @@ -175,7 +175,7 @@ mvn test -DskipTests=false ``` CAVEAT: If initialization fails, double check your database credentials! If invalid the error might be somewhat hidden behind a - Torque exception! + Torque exception! Docker: If you have not initialized docker when creating the archetype instance, you have to edit TorqueTest.properties and adapt the url from localhost to db. You may then run the tests from inside the container service app. ## IDE Integration, Eclipse
