<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2018 Cox Automotive UK Limited

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>waimak-parent_2.11</artifactId>
        <groupId>com.coxautodata</groupId>
        <version>2.8</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>waimak-rdbm-ingestion_2.11</artifactId>

    <properties>

    </properties>

    <dependencies>
        <dependency>
            <groupId>com.coxautodata</groupId>
            <artifactId>waimak-core_2.11</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.coxautodata</groupId>
            <artifactId>waimak-storage_2.11</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>com.coxautodata</groupId>
            <artifactId>waimak-core_2.11</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${jdbc.postgres.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>${jdbc.mssql.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>${docker.maven.plugin.version}</version>
                <configuration>
                    <images>
                        <image>
                            <name>microsoft/mssql-server-linux:2017-latest</name>
                            <alias>it-sqlserver</alias>
                            <run>
                                <namingStrategy>alias</namingStrategy>
                                <ports>
                                    <port>1401:1433</port>
                                </ports>
                                <env>
                                    <ACCEPT_EULA>Y</ACCEPT_EULA>
                                    <MSSQL_SA_PASSWORD>SQLServer123!</MSSQL_SA_PASSWORD>
                                </env>
                            </run>
                        </image>
                        <image>
                            <name>postgres:9.6.5</name>
                            <alias>it-postgres</alias>
                            <run>
                                <namingStrategy>alias</namingStrategy>
                                <ports>
                                    <port>5433:5432</port>
                                </ports>
                                <env>
                                    <POSTGRES_USER>postgres</POSTGRES_USER>
                                    <POSTGRES_PASSWORD>Postgres123!</POSTGRES_PASSWORD>
                                </env>
                            </run>
                        </image>
                    </images>
                </configuration>
                <executions>
                    <execution>
                        <id>prepare-it-database</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <skip>${skipITs}</skip>
                        </configuration>
                    </execution>
                    <execution>
                        <id>remove-it-database</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                            <goal>remove</goal>
                        </goals>
                        <configuration>
                            <skip>${skipITs}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
