Add simplified local setup
[aai/test-config.git] / local-setup / pom.xml
diff --git a/local-setup/pom.xml b/local-setup/pom.xml
new file mode 100644 (file)
index 0000000..a2c1c22
--- /dev/null
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    ============LICENSE_START=======================================================
+    org.onap.aai
+    ================================================================================
+    Copyright © 2018-2019 Nokia Intellectual Property. All rights reserved.
+    ================================================================================
+    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.
+    ============LICENSE_END=========================================================
+
+-->
+<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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.onap.aai.aai-common</groupId>
+    <artifactId>local-setup</artifactId>
+    <version>1.4.1-SNAPSHOT</version>
+
+    <profiles>
+        <profile>
+            <id>integration-test</id>
+            <properties>
+                <skipITs>false</skipITs>
+            </properties>
+        </profile>
+        <profile>
+            <id>docker-proxy</id>
+            <!-- activate profile if environment variable `http_proxy` is set -->
+            <activation>
+                <property>
+                    <name>env.http_proxy</name>
+                </property>
+            </activation>
+            <properties>
+                <docker.buildArg.http_proxy>${env.http_proxy}</docker.buildArg.http_proxy>
+            </properties>
+        </profile>
+    </profiles>
+
+    <properties>
+        <maven.compiler.target>1.8</maven.compiler.target>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <skipITs>true</skipITs>
+
+        <!-- docker related -->
+        <docker.name.janusgraph>onap/aai-janus-dev</docker.name.janusgraph>
+        <docker.name.haproxy>onap/aai-haproxy-dev</docker.name.haproxy>
+        <docker.dir.janusgraph>${project.basedir}/src/main/docker/janusgraph</docker.dir.janusgraph>
+        <docker.dir.haproxy>${project.basedir}/src/main/docker/haproxy</docker.dir.haproxy>
+        <docker.test.port>8443</docker.test.port>
+
+        <!-- dependencies versions -->
+        <assertj-core.version>3.11.1</assertj-core.version>
+        <commons-csv.version>1.6</commons-csv.version>
+        <docker-maven-plugin.version>0.28.0</docker-maven-plugin.version>
+        <http-request.version>6.0</http-request.version>
+        <jackson-databind.version>2.9.8</jackson-databind.version>
+        <jsonassert.version>1.5.0</jsonassert.version>
+        <json-path.version>2.4.0</json-path.version>
+        <junit.version>4.12</junit.version>
+    </properties>
+
+    <dependencies>
+        <!-- compile dependencies -->
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-csv</artifactId>
+            <version>${commons-csv.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.github.kevinsawicki</groupId>
+            <artifactId>http-request</artifactId>
+            <version>${http-request.version}</version>
+        </dependency>
+
+        <!-- json utils -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${jackson-databind.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.jayway.jsonpath</groupId>
+            <artifactId>json-path</artifactId>
+            <version>${json-path.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.skyscreamer</groupId>
+            <artifactId>jsonassert</artifactId>
+            <version>${jsonassert.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <version>${assertj-core.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>io.fabric8</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>${docker-maven-plugin.version}</version>
+                <configuration>
+                    <skipRun>${skipITs}</skipRun>
+                    <verbose>true</verbose>
+                    <images>
+                        <image>
+                            <alias>aai-storage</alias>
+                            <name>${docker.name.janusgraph}</name>
+                            <build>
+                                <dockerFileDir>${docker.dir.janusgraph}</dockerFileDir>
+                            </build>
+                            <run>
+                                <skip>true</skip><!-- avoid multiple instances -->
+                            </run>
+                        </image>
+                        <image>
+                            <alias>aai-haproxy</alias>
+                            <name>${docker.name.haproxy}</name>
+                            <build>
+                                <dockerFileDir>${docker.dir.haproxy}</dockerFileDir>
+                            </build>
+                            <run>
+                                <wait>
+                                    <time>150000</time>
+                                    <tcp>
+                                        <host>localhost</host>
+                                        <ports>
+                                            <!-- wait for janusgraph-server ports -->
+                                            <port>9200</port>
+                                            <port>8182</port>
+                                        </ports>
+                                    </tcp>
+                                </wait>
+                            </run>
+                            <external>
+                                <type>compose</type>
+                            </external>
+                        </image>
+                    </images>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>build</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>build</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>setup-IT</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>start</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>teardown-IT</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <version>3.0.0-M3</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>integration-test</goal>
+                            <goal>verify</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file