Make all configuration execution specific.

This introduces some duplication for the start/stop db executions, but
I can't see any way to avoid that. We don't want the other
configuration being shared between executions.

Ensure the db start/stop execution triggers for repo and not for share.
This commit is contained in:
Tom Page
2019-09-25 11:41:54 +01:00
parent 4461495d85
commit 8c16f9351f
2 changed files with 151 additions and 100 deletions

128
pom.xml
View File

@@ -260,6 +260,14 @@
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${fabric8.docker.version}</version>
<executions>
<execution>
<id>build-image</id>
<!-- This will still be executed if the tests are skipped. -->
<phase>verify</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<images>
<image>
@@ -270,14 +278,6 @@
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-image</id>
<!-- This will still be executed if the tests are skipped. -->
<phase>verify</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -296,6 +296,14 @@
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${fabric8.docker.version}</version>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<images>
<image>
@@ -307,14 +315,6 @@
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -334,6 +334,14 @@
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${fabric8.docker.version}</version>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<images>
<image>
@@ -351,14 +359,6 @@
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -378,6 +378,14 @@
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${fabric8.docker.version}</version>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<images>
<image>
@@ -389,14 +397,6 @@
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -416,6 +416,14 @@
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${fabric8.docker.version}</version>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<images>
<image>
@@ -433,14 +441,6 @@
</image>
</images>
</configuration>
<executions>
<execution>
<id>build-push-image</id>
<phase>deploy</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
@@ -463,6 +463,13 @@
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${fabric8.docker.version}</version>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<images>
<image>
@@ -497,13 +504,6 @@
</image>
</images>
</configuration>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop</id>
@@ -511,6 +511,40 @@
<goals>
<goal>stop</goal>
</goals>
<configuration>
<images>
<image>
<alias>test-database</alias>
<name>postgres:${postgres.version}</name>
<run>
<ports>
<port>${database.port}:${postgresql.port}</port>
</ports>
<env>
<POSTGRES_PASSWORD>${alfresco.db.password}</POSTGRES_PASSWORD>
<POSTGRES_USER>${alfresco.db.username}</POSTGRES_USER>
<POSTGRES_DB>${alfresco.test.db.name}</POSTGRES_DB>
</env>
<cmd>
<shell>-c max_connections=300</shell>
</cmd>
<wait>
<log>database system is ready to accept connections</log>
<time>20000</time>
</wait>
</run>
</image>
<image>
<name>alfresco/alfresco-activemq:${activemq.version}</name>
<run>
<ports>
<port>${activemq.port1}:${activemq.port1}</port>
<port>${activemq.port2}:${activemq.port2}</port>
</ports>
</run>
</image>
</images>
</configuration>
</execution>
</executions>
</plugin>

View File

@@ -666,5 +666,22 @@
</plugins>
</build>
</profile>
<profile>
<id>start-db</id>
<activation>
<property>
<name>skip.integrationtests</name>
<value>false</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>