mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-06-02 17:35:25 +00:00
Archetypes - Change platform archetype build approach
- Build the project using package goal instead of install - Copy the test dependencies only when IT is executed - Add the build_start_it_supported task to execution scripts
This commit is contained in:
parent
d949a778ef
commit
ea4c12a836
@ -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 docker image, start the dockerised environment composed by ACS, Share (optional), ASS
|
* `build_start`. Build the whole project, recreate the ACS docker image, start the dockerised environment composed by ACS, Share (optional), ASS
|
||||||
and PostgreSQL and tail the logs of all the containers.
|
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 docker image, start the dockerised environment
|
||||||
|
composed by ACS, Share (optional), 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.
|
* `start`. Start the dockerised environment without building the project and tail the logs of all the containers.
|
||||||
* `stop`. Stop the dockerised environment.
|
* `stop`. Stop the dockerised environment.
|
||||||
* `purge`. Stop the dockerised container and delete all the persistent data (docker volumes).
|
* `purge`. Stop the dockerised container and delete all the persistent data (docker volumes).
|
||||||
|
@ -192,6 +192,44 @@
|
|||||||
</resources>
|
</resources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>copy-repository-extension</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>target</directory>
|
||||||
|
<includes>
|
||||||
|
<include>${build.finalName}.jar</include>
|
||||||
|
</includes>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>copy-repository-tests</id>
|
||||||
|
<phase>pre-integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>target</directory>
|
||||||
|
<includes>
|
||||||
|
<include>${build.finalName}-tests.jar</include>
|
||||||
|
</includes>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
@ -200,73 +238,29 @@
|
|||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.1.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<!-- Copy the repository extension and the dependencies required for execute integration tests -->
|
<!-- Copy the dependencies required for execute integration tests -->
|
||||||
<execution>
|
<execution>
|
||||||
<id>copy-repo-extension</id>
|
<id>collect-test-artifacts</id>
|
||||||
<phase>pre-integration-test</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<artifactItems>
|
|
||||||
<artifactItem>
|
|
||||||
<groupId>${groupId}</groupId>
|
|
||||||
<artifactId>${artifactId}</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<overWrite>false</overWrite>
|
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
|
||||||
</artifactItem>
|
|
||||||
<!-- Test dependencies -->
|
|
||||||
<!-- We need these dependencies installed in ACS in order to execute the test remotely making use of the Alfresco RAD module -->
|
|
||||||
<artifactItem>
|
|
||||||
<groupId>${groupId}</groupId>
|
|
||||||
<artifactId>${artifactId}</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<classifier>tests</classifier>
|
|
||||||
<overWrite>false</overWrite>
|
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
|
||||||
</artifactItem>
|
|
||||||
<artifactItem>
|
|
||||||
<groupId>org.alfresco.maven</groupId>
|
|
||||||
<artifactId>alfresco-rad</artifactId>
|
|
||||||
<version>${alfresco.sdk.version}</version>
|
|
||||||
<overWrite>false</overWrite>
|
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
|
||||||
</artifactItem>
|
|
||||||
<artifactItem>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.12</version>
|
|
||||||
<overWrite>false</overWrite>
|
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
|
||||||
</artifactItem>
|
|
||||||
<artifactItem>
|
|
||||||
<groupId>org.mockito</groupId>
|
|
||||||
<artifactId>mockito-all</artifactId>
|
|
||||||
<version>1.9.5</version>
|
|
||||||
<overWrite>false</overWrite>
|
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
|
||||||
</artifactItem>
|
|
||||||
<artifactItem>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
<version>4.5.2</version>
|
|
||||||
<overWrite>false</overWrite>
|
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
|
||||||
</artifactItem>
|
|
||||||
</artifactItems>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<!-- Copy other dependencies (JARs or AMPs) declared in the platform module -->
|
|
||||||
<execution>
|
|
||||||
<id>copy-third-party-dependencies</id>
|
|
||||||
<phase>pre-integration-test</phase>
|
<phase>pre-integration-test</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>copy-dependencies</goal>
|
<goal>copy-dependencies</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
||||||
|
<excludeScope>compile</excludeScope>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<!-- Collect extensions (JARs or AMPs) declared in this module to be deployed to docker -->
|
||||||
|
<execution>
|
||||||
|
<id>collect-extensions</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
||||||
<includeScope>runtime</includeScope>
|
<includeScope>runtime</includeScope>
|
||||||
|
<!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
@ -12,7 +12,7 @@ IF NOT [%M2_HOME%]==[] (
|
|||||||
)
|
)
|
||||||
|
|
||||||
IF [%1]==[] (
|
IF [%1]==[] (
|
||||||
echo "Usage: %0 {build_start|start|stop|purge|tail|build_test|test}"
|
echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|build_test|test}"
|
||||||
GOTO END
|
GOTO END
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,6 +23,14 @@ IF %1==build_start (
|
|||||||
CALL :tail
|
CALL :tail
|
||||||
GOTO END
|
GOTO END
|
||||||
)
|
)
|
||||||
|
IF %1==build_start_it_supported (
|
||||||
|
CALL :down
|
||||||
|
CALL :build
|
||||||
|
CALL :prepare_test
|
||||||
|
CALL :start
|
||||||
|
CALL :tail
|
||||||
|
GOTO END
|
||||||
|
)
|
||||||
IF %1==start (
|
IF %1==start (
|
||||||
CALL :start
|
CALL :start
|
||||||
CALL :tail
|
CALL :tail
|
||||||
@ -44,6 +52,7 @@ IF %1==tail (
|
|||||||
IF %1==build_test (
|
IF %1==build_test (
|
||||||
CALL :down
|
CALL :down
|
||||||
CALL :build
|
CALL :build
|
||||||
|
CALL :prepare_test
|
||||||
CALL :start
|
CALL :start
|
||||||
CALL :test
|
CALL :test
|
||||||
CALL :tail_all
|
CALL :tail_all
|
||||||
@ -70,7 +79,7 @@ EXIT /B 0
|
|||||||
)
|
)
|
||||||
EXIT /B 0
|
EXIT /B 0
|
||||||
:build
|
:build
|
||||||
call %MVN_EXEC% clean install -DskipTests
|
call %MVN_EXEC% clean package
|
||||||
EXIT /B 0
|
EXIT /B 0
|
||||||
:tail
|
:tail
|
||||||
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
|
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
|
||||||
@ -78,6 +87,9 @@ EXIT /B 0
|
|||||||
:tail_all
|
:tail_all
|
||||||
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
|
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
|
||||||
EXIT /B 0
|
EXIT /B 0
|
||||||
|
:prepare_test
|
||||||
|
call %MVN_EXEC% verify -DskipTests=true
|
||||||
|
EXIT /B 0
|
||||||
:test
|
:test
|
||||||
call %MVN_EXEC% verify
|
call %MVN_EXEC% verify
|
||||||
EXIT /B 0
|
EXIT /B 0
|
||||||
|
@ -29,7 +29,7 @@ purge() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
${symbol_dollar}MVN_EXEC clean install -DskipTests=true
|
${symbol_dollar}MVN_EXEC clean package
|
||||||
}
|
}
|
||||||
|
|
||||||
tail() {
|
tail() {
|
||||||
@ -40,6 +40,10 @@ tail_all() {
|
|||||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
|
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepare_test() {
|
||||||
|
${symbol_dollar}MVN_EXEC verify -DskipTests=true
|
||||||
|
}
|
||||||
|
|
||||||
test() {
|
test() {
|
||||||
${symbol_dollar}MVN_EXEC verify
|
${symbol_dollar}MVN_EXEC verify
|
||||||
}
|
}
|
||||||
@ -51,6 +55,13 @@ case "${symbol_dollar}1" in
|
|||||||
start
|
start
|
||||||
tail
|
tail
|
||||||
;;
|
;;
|
||||||
|
build_start_it_supported)
|
||||||
|
down
|
||||||
|
build
|
||||||
|
prepare_test
|
||||||
|
start
|
||||||
|
tail
|
||||||
|
;;
|
||||||
start)
|
start)
|
||||||
start
|
start
|
||||||
tail
|
tail
|
||||||
@ -68,6 +79,7 @@ case "${symbol_dollar}1" in
|
|||||||
build_test)
|
build_test)
|
||||||
down
|
down
|
||||||
build
|
build
|
||||||
|
prepare_test
|
||||||
start
|
start
|
||||||
test
|
test
|
||||||
tail_all
|
tail_all
|
||||||
@ -77,5 +89,5 @@ case "${symbol_dollar}1" in
|
|||||||
test
|
test
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: ${symbol_dollar}0 {build_start|start|stop|purge|tail|build_test|test}"
|
echo "Usage: ${symbol_dollar}0 {build_start|build_start_it_supported|start|stop|purge|tail|build_test|test}"
|
||||||
esac
|
esac
|
Loading…
x
Reference in New Issue
Block a user