Commit 6e5445a2 authored by Piotr Anders's avatar Piotr Anders
Browse files

* Changing run scripts to execute maven package/verify instead of install (and...

* Changing run scripts to execute maven package/verify instead of install (and to run unit tests during build).
* Changing artifacts collection for docker deployment in platform-docker module to use scopes (for integration tests) and adding comment how to deal with amps only or amps+jars extenstions.
parent 2db30515
Loading
Loading
Loading
Loading
+28 −46
Original line number Diff line number Diff line
@@ -22,6 +22,25 @@
            <artifactId>${rootArtifactId}-platform</artifactId>
            <version>${version}</version>
        </dependency>
        <dependency>
            <groupId>${groupId}</groupId>
            <artifactId>${rootArtifactId}-integration-tests</artifactId>
            <version>${version}</version>
            <scope>test</scope>
            <classifier>tests</classifier>
        </dependency>
        <!-- Add any additional AMPs or extension JARs here that you want to be deployed in Alfresco -->
        <!-- IMPORTANT: 
             If using amp extensions only, add <includeTypes>amp</includeTypes> to the "collect-extensions" execution below.
             If using both amp and jar extensions, you have to add: 
                <exclusions>
                  <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                  </exclusion>
                </exclusions>
             to each amp dependency definition.
         -->
    </dependencies>

    <build>
@@ -30,66 +49,29 @@
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Copy the dependencies required for execute integration tests -->
                    <!-- Copy the repository extension and the dependencies required for execute integration tests -->
                    <execution>
                        <id>copy-test-dependencies</id>
                        <id>collect-test-artifacts</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>copy</goal>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <!-- 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>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>${groupId}</groupId>
                                    <artifactId>${rootArtifactId}-integration-tests</artifactId>
                                    <version>${version}</version>
                                    <classifier>tests</classifier>
                                    <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>
                            <excludeScope>compile</excludeScope>
                        </configuration>
                    </execution>
                    <!-- Copy the dependencies (JARs or AMPs) declared in this module -->
                    <!-- Collect extensions (JARs or AMPs) declared in this module do be deployed to docker -->
                    <execution>
                        <id>copy-third-party-dependencies</id>
                        <phase>pre-integration-test</phase>
                        <id>collect-extensions</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/extensions</outputDirectory>
                            <includeScope>runtime</includeScope>
                            <!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
                        </configuration>
                    </execution>
                </executions>
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
    </properties>

    <dependencies>
        <!-- Add here any JAR or AMP dependency that needs to be deployed to ACS -->
    </dependencies>

    <build>
+4 −3
Original line number Diff line number Diff line
@@ -30,16 +30,17 @@
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Copy the dependencies (JARs or AMPs) declared in this module -->
                    <!-- Collect extensions (JARs or AMPs) declared in this module do be deployed to docker -->
                    <execution>
                        <id>copy-third-party-dependencies</id>
                        <phase>pre-integration-test</phase>
                        <id>collect-extensions</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/extensions</outputDirectory>
                            <includeScope>runtime</includeScope>
                            <!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
                        </configuration>
                    </execution>
                </executions>
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
            <artifactId>share</artifactId>
            <classifier>classes</classifier>
        </dependency>
        <!-- Add here any JAR or AMP dependency that needs to be deployed to share -->
    </dependencies>

    <build>
+8 −4
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ IF %1==reload_acs (
IF %1==build_test (
    CALL :down
    CALL :build
    CALL :prepare-test
    CALL :start
    CALL :test
    CALL :tail_all
@@ -88,17 +89,17 @@ EXIT /B 0
    )
EXIT /B 0
:build
	call %MVN_EXEC% clean install -DskipTests
	call %MVN_EXEC% clean package
EXIT /B 0
:build_share
    docker-compose -f "%COMPOSE_FILE_PATH%" kill ${rootArtifactId}-share
    docker-compose -f "%COMPOSE_FILE_PATH%" rm -f ${rootArtifactId}-share
	call %MVN_EXEC% clean install -DskipTests -pl ${rootArtifactId}-share
	call %MVN_EXEC% clean package -pl ${rootArtifactId}-share,${rootArtifactId}-share-docker
EXIT /B 0
:build_acs
    docker-compose -f "%COMPOSE_FILE_PATH%" kill ${rootArtifactId}-acs
    docker-compose -f "%COMPOSE_FILE_PATH%" rm -f ${rootArtifactId}-acs
	call %MVN_EXEC% clean install -DskipTests -pl ${rootArtifactId}-platform
	call %MVN_EXEC% clean package -pl ${rootArtifactId}-platform,${rootArtifactId}-platform-docker
EXIT /B 0
:tail
    docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
@@ -106,8 +107,11 @@ EXIT /B 0
:tail_all
    docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
EXIT /B 0
:prepare-test
    call %MVN_EXEC% verify -DskipTests=true -pl ${rootArtifactId}-platform,${rootArtifactId}-integration-tests,${rootArtifactId}-platform-docker
EXIT /B 0
:test
    call %MVN_EXEC% verify -pl ${rootArtifactId}-integration-tests
    call %MVN_EXEC% verify -pl ${rootArtifactId}-platform,${rootArtifactId}-integration-tests
EXIT /B 0
:purge
    docker volume rm -f ${rootArtifactId}-acs-volume
Loading