diff options
Diffstat (limited to 'ms/gra/gra-docker/pom.xml')
-rw-r--r-- | ms/gra/gra-docker/pom.xml | 325 |
1 files changed, 325 insertions, 0 deletions
diff --git a/ms/gra/gra-docker/pom.xml b/ms/gra/gra-docker/pom.xml new file mode 100644 index 0000000..af9b80c --- /dev/null +++ b/ms/gra/gra-docker/pom.xml @@ -0,0 +1,325 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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> + + <parent> + <groupId>org.onap.sdnc.apps</groupId> + <artifactId>gra</artifactId> + <version>2.1.0-SNAPSHOT</version> + </parent> + + <groupId>org.onap.sdnc.apps</groupId> + <artifactId>gra-docker</artifactId> + <version>2.1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>sdnc-apps :: ms :: gra :: ${project.artifactId}</name> + <description>Generic Resource API docker creation</description> + <url>http://wiki.onap.org</url> + + <properties> + <base.image.name>onap/ccsdk-alpine-j11-image</base.image.name> + <image.name>onap/sdnc-gra-image</image.name> + <ccsdk.project.version>${project.version}</ccsdk.project.version> + <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp> + <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> + <sdnc.gra.jar>gra-app-${project.version}.jar</sdnc.gra.jar> + <onap.truststore>truststoreONAPall.jks</onap.truststore> + <docker.push.phase>deploy</docker.push.phase> + <docker.autoCreateCustomNetworks>true</docker.autoCreateCustomNetworks> + </properties> + + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>gra-app</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + + + <profiles> + <profile> + <id>docker</id> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.groovy.maven</groupId> + <artifactId>gmaven-plugin</artifactId> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source>${basedir}/../../../TagVersion.groovy</source> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <version>2.10</version> + + <executions> + <execution> + <id>copy-dependencies</id> + <goals> + <goal>copy-dependencies</goal> + </goals> + <phase>process-resources</phase> + <configuration> + <excludeTransitive>true</excludeTransitive> + <outputDirectory>${project.build.directory}/docker-stage/opt/onap/sdnc/lib</outputDirectory> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>true</overWriteSnapshots> + <overWriteIfNewer>true</overWriteIfNewer> + <useRepositoryLayout>false</useRepositoryLayout> + <addParentPoms>false</addParentPoms> + <copyPom>false</copyPom> + </configuration> + </execution> + <execution> + <id>unpack dgs</id> + <phase>generate-sources</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>org.onap.sdnc.oam</groupId> + <artifactId>platform-logic-installer</artifactId> + <version>${sdnc.oam.version}</version> + <type>zip</type> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <id>copy-dockerfile</id> + <goals> + <goal>copy-resources</goal> + </goals> <!-- here the phase you need --> + <phase>initialize</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage</outputDirectory> + <resources> + <resource> + <directory>src/main/docker</directory> + <includes> + <include>Dockerfile</include> + </includes> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + <execution> + <id>copy-config</id> + <goals> + <goal>copy-resources</goal> + </goals> <!-- here the phase you need --> + <phase>generate-resources</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/config</outputDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>*.properties</include> + <include>*.props</include> + <include>*.sql</include> + </includes> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + <execution> + <id>copy-jks</id> + <goals> + <goal>copy-resources</goal> + </goals> <!-- here the phase you need --> + <phase>generate-resources</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/config</outputDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>*.jks</include> + </includes> + <filtering>false</filtering> + </resource> + </resources> + </configuration> + </execution> + <execution> + <id>copy-script</id> + <goals> + <goal>copy-resources</goal> + </goals> <!-- here the phase you need --> + <phase>generate-resources</phase> + <configuration> + <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/bin</outputDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>*.sh</include> + </includes> + <filtering>true</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + <configuration> + <skipITs>false</skipITs> + <environmentVariables> + <GRA_PORT>${gra.port}</GRA_PORT> + </environmentVariables> + </configuration> + </plugin> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.28.0</version> + <inherited>false</inherited> + <configuration> + <images> + <image> + <name>${image.name}</name> + <build> + <cleanup>try</cleanup> + <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> + <dockerFile>Dockerfile</dockerFile> + <tags> + <tag>${project.docker.latestminortag.version}</tag> + <tag>${project.docker.latestfulltag.version}</tag> + <tag>${project.docker.latesttagtimestamp.version}</tag> + </tags> + </build> + </image> + </images> + </configuration> + <executions> + <execution> + <id>generate-images</id> + <phase>package</phase> + <goals> + <goal>build</goal> + </goals> + </execution> + <execution> + <id>start-it-instance</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + <configuration> + <images> + <image> + <name>mariadb:10.5</name> + <alias>gradb</alias> + <run> + <env> + <MYSQL_ROOT_PASSWORD>${gratest.mysql.root.password}</MYSQL_ROOT_PASSWORD> + <MYSQL_USER>${gratest.mysql.user}</MYSQL_USER> + <MYSQL_PASSWORD>${gratest.mysql.password}</MYSQL_PASSWORD> + <MYSQL_DATABASE>${gratest.mysql.database}</MYSQL_DATABASE> + </env> + <network> + <mode>custom</mode> + <name>gra</name> + <alias>dbhost</alias> + </network> + <ports> + <port>gradb.port:3306</port> + </ports> + <log> + <enabled>true</enabled> + </log> + </run> + </image> + <image> + <name>${image.name}:${project.docker.latesttagtimestamp.version}</name> + <alias>gra-container</alias> + <run> + <env> + <MYSQL_ROOT_PASSWORD>${gratest.mysql.root.password}</MYSQL_ROOT_PASSWORD> + <MYSQL_DB_HOST>dbhost</MYSQL_DB_HOST> + <MYSQL_USER>${gratest.mysql.user}</MYSQL_USER> + <MYSQL_PASSWORD>${gratest.mysql.password}</MYSQL_PASSWORD> + <MYSQL_DATABASE>${gratest.mysql.database}</MYSQL_DATABASE> + <LOG_LEVEL>INFO</LOG_LEVEL> + <SDNC_CONFIG_DIR>/opt/onap/sdnc/config</SDNC_CONFIG_DIR> + </env> + <dependsOn> + <container>gradb</container> + </dependsOn> + <network> + <mode>custom</mode> + <name>gra</name> + <alias>gra</alias> + </network> + <ports> + <port>gra.port:8080</port> + </ports> + <wait> + <log>Started GenericResourceMsApp</log> + <time>240000</time> + </wait> + <log> + <enabled>true</enabled> + </log> + </run> + </image> + </images> + </configuration> + </execution> + <execution> + <id>stop-it-instance</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + <execution> + <id>push-images</id> + <phase>${docker.push.phase}</phase> + <goals> + <goal>build</goal> + <goal>push</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> |