From deaf4c06b8e463258b58aed8c63640fa4ffa9290 Mon Sep 17 00:00:00 2001 From: Jose Luis Osorno Date: Mon, 25 Mar 2019 12:14:43 +0100 Subject: [PATCH] Archetypes - Add build with IT supported task Modify the run scripts to add the task: build_start_it_supported. After the last changes regarding the way the project is compiled and retrieves the IT dependencies, it losted the ability to run the project in docker with IT support (including the libraries required to execute IT) but without executing the tests. It only had build_start (no IT supported) and build_test (IT supported but started and stopped the environment after IT execution). This new task allows the execution of the docker environment with IT execution supported to cover the next use cases: - Running IT classes from IDE (for instance, to debug the execution). - Running IT classes with hot reload enabled. --- .../src/main/resources/archetype-resources/README.md | 2 ++ .../src/main/resources/archetype-resources/run.bat | 10 +++++++++- .../src/main/resources/archetype-resources/run.sh | 9 ++++++++- docs/advanced-topics/integration-testing/it-running.md | 10 +++++----- docs/working-with-generated-projects/README.md | 1 + 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.md b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.md index 01c8a936..e8b66faf 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.md +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/README.md @@ -14,6 +14,8 @@ All the services of the project are now run as docker containers. The run script * `build_start`. Build the whole project, recreate the ACS and Share docker images, start the dockerised environment composed by ACS, Share, ASS and PostgreSQL and tail the logs of all the containers. + * `build_start_it_supported`. Build the whole project including dependencies required for IT execution, recreate the ACS and Share docker images, start the + dockerised environment composed by ACS, Share, ASS and PostgreSQL and tail the logs of all the containers. * `start`. Start the dockerised environment without building the project and tail the logs of all the containers. * `stop`. Stop the dockerised environment. * `purge`. Stop the dockerised container and delete all the persistent data (docker volumes). diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.bat b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.bat index 65eb6672..5ca96776 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.bat +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.bat @@ -12,7 +12,7 @@ IF NOT [%M2_HOME%]==[] ( ) IF [%1]==[] ( - echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}" + echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}" GOTO END ) @@ -23,6 +23,14 @@ IF %1==build_start ( CALL :tail GOTO END ) +IF %1==build_start_it_supported ( + CALL :down + CALL :build + CALL :prepare-test + CALL :start + CALL :tail + GOTO END +) IF %1==start ( CALL :start CALL :tail diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.sh b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.sh index d944ccf9..bb8dbd66 100755 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.sh +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/run.sh @@ -75,6 +75,13 @@ case "${symbol_dollar}1" in start tail ;; + build_start_it_supported) + down + build + prepare_test + start + tail + ;; start) start tail @@ -112,5 +119,5 @@ case "${symbol_dollar}1" in test ;; *) - echo "Usage: ${symbol_dollar}0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}" + echo "Usage: ${symbol_dollar}0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}" esac \ No newline at end of file diff --git a/docs/advanced-topics/integration-testing/it-running.md b/docs/advanced-topics/integration-testing/it-running.md index adf7b24c..2c71c9e9 100644 --- a/docs/advanced-topics/integration-testing/it-running.md +++ b/docs/advanced-topics/integration-testing/it-running.md @@ -20,7 +20,7 @@ $ ./run.sh build_test ``` If you want all your previous data in the docker environment to be wiped out before the execution of the integration tests, remember to call the `purge` goal -before the `build_start` goal: +before the `build_test` goal: ``` $ ./run.sh purge @@ -69,8 +69,8 @@ If your project is available in Eclipse, you can easily run one or more of the i To run the integration tests: -1. In order to properly execute the integration tests the dockerised environment must be already up and running. So, before executing the tests you must run -the `build_start` or the `start` goal of the `run` script. +1. In order to properly execute the integration tests the dockerised environment must be already up and running with IT support. So, before executing the tests +you must run the `build_start_it_supported` or the `start` goal of the `run` script. 2. Open the project using the IDE. @@ -95,8 +95,8 @@ If your project is available in IntelliJ IDEA, you can easily run one or more of To run the integration tests: -1. In order to properly execute the integration tests the dockerised environment must be already up and running. So, before executing the tests you must run -the `build_start` or the `start` goal of the `run` script. +1. In order to properly execute the integration tests the dockerised environment must be already up and running with IT support. So, before executing the tests +you must run the `build_start_it_supported` or the `start` goal of the `run` script. 2. Open the project using the IDE. diff --git a/docs/working-with-generated-projects/README.md b/docs/working-with-generated-projects/README.md index 1ddb9873..4e38ac4e 100644 --- a/docs/working-with-generated-projects/README.md +++ b/docs/working-with-generated-projects/README.md @@ -37,6 +37,7 @@ The execution of this script must be followed by a parameter that dictates the t Task | Description --- | --- `build_start` | Build the whole project, recreate the ACS and Share docker images, start the dockerised environment composed by ACS, Share, ASS and PostgreSQL and tail the logs of all the containers. +`build_start_it_supported` | Build the whole project including dependencies required for IT execution, recreate the ACS and Share docker images, start the dockerised environment composed by ACS, Share, ASS and PostgreSQL and tail the logs of all the containers. `start` | Start the dockerised environment without building the project and tail the logs of all the containers. `stop` | Stop the dockerised environment. `purge` | Stop the dockerised environment and delete all the persistent data (docker volumes).