blob: 45059e5f1f5984af415feb4ef450cbcc25dd65c8 [file] [log] [blame]
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -05001<?xml version="1.0" encoding="UTF-8"?>
2<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Dan Timoney8f773512017-04-24 16:30:26 -04003 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -05004
Dan Timoney8f773512017-04-24 16:30:26 -04005 <parent>
Timoney, Dan (dt5972)63298742018-03-01 10:59:28 -05006 <groupId>org.onap.ccsdk.parent</groupId>
7 <artifactId>odlparent-lite</artifactId>
8 <version>1.0.1-SNAPSHOT</version>
Dan Timoney8f773512017-04-24 16:30:26 -04009 </parent>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050010
Dan Timoney8f773512017-04-24 16:30:26 -040011 <modelVersion>4.0.0</modelVersion>
12 <packaging>pom</packaging>
Dan Timoney98ddb132017-09-01 17:40:45 -040013 <groupId>org.onap.sdnc.oam</groupId>
Dan Timoney8f773512017-04-24 16:30:26 -040014 <artifactId>installation-admportal</artifactId>
Timoney, Dan (dt5972)63298742018-03-01 10:59:28 -050015 <version>1.3.1-SNAPSHOT</version>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050016
Timoney, Dan (dt5972)63298742018-03-01 10:59:28 -050017 <name>sdnc-oam :: installation :: ${project.artifactId}</name>
Dan Timoney8f773512017-04-24 16:30:26 -040018 <description>Creates admportal Docker container</description>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050019
Dan Timoney8f773512017-04-24 16:30:26 -040020 <properties>
Dan Timoney98ddb132017-09-01 17:40:45 -040021 <image.name>onap/admportal-sdnc-image</image.name>
Dan Timoney8f773512017-04-24 16:30:26 -040022 <sdnc.project.version>${project.version}</sdnc.project.version>
Timoney, Dan (dt5972)7b539402018-04-06 18:00:00 -040023 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
Dan Timoney8f773512017-04-24 16:30:26 -040024 </properties>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050025
26
Dan Timoney8f773512017-04-24 16:30:26 -040027 <build>
28 <plugins>
29
30 <plugin>
31 <groupId>org.codehaus.groovy.maven</groupId>
32 <artifactId>gmaven-plugin</artifactId>
33 <executions>
34 <execution>
35 <phase>validate</phase>
36 <goals>
37 <goal>execute</goal>
38 </goals>
39 <configuration>
40 <source>
41 println project.properties['sdnc.project.version'];
42 def versionArray;
43 if ( project.properties['sdnc.project.version'] != null ) {
Dan Timoney687146e2017-04-25 08:43:30 -040044 versionArray =
45 project.properties['sdnc.project.version'].split('\\.');
Dan Timoney8f773512017-04-24 16:30:26 -040046 }
47
Dan Timoney687146e2017-04-25 08:43:30 -040048 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT")) {
Dan Timoney47020692017-05-15 10:28:02 -040049 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
Dan Timoney8f773512017-04-24 16:30:26 -040050 } else {
Dan Timoney687146e2017-04-25 08:43:30 -040051 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
Dan Timoney8f773512017-04-24 16:30:26 -040052 }
53
54 println 'New Tag for docker:' +
55 project.properties['project.docker.latesttag.version'];
56 </source>
57 </configuration>
58 </execution>
59 </executions>
60 </plugin>
61 <plugin>
62 <groupId>io.fabric8</groupId>
63 <artifactId>docker-maven-plugin</artifactId>
64 <version>0.16.5</version>
65 <inherited>false</inherited>
66 <configuration>
67
68 <images>
69 <image>
70 <name>${image.name}</name>
71 <build>
72 <cleanup>try</cleanup>
73 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
74 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
75 <tags>
Dan Timoney687146e2017-04-25 08:43:30 -040076 <tag>${project.version}</tag>
Dan Timoney8f773512017-04-24 16:30:26 -040077 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
78 <tag>${project.docker.latesttag.version}</tag>
79 </tags>
80 </build>
81 </image>
82 </images>
83 </configuration>
84 <executions>
85 <execution>
86 <id>generate-images</id>
87 <phase>generate-sources</phase>
88 <goals>
89 <goal>build</goal>
90 </goals>
91 </execution>
92
93 <execution>
94 <id>push-images</id>
95 <phase>deploy</phase>
96 <goals>
97 <goal>build</goal>
98 <goal>push</goal>
99 </goals>
100 </execution>
101 </executions>
102 </plugin>
103
104 <plugin>
105 <artifactId>maven-resources-plugin</artifactId>
106 <version>2.6</version>
107 <executions>
108 <execution>
109 <id>copy-dockerfile</id>
110 <goals>
111 <goal>copy-resources</goal>
112 </goals><!-- here the phase you need -->
113 <phase>validate</phase>
114 <configuration>
115 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
116 <resources>
117 <resource>
118 <directory>src/main/docker</directory>
119 <includes>
120 <include>Dockerfile</include>
121 </includes>
122 <filtering>true</filtering>
123 </resource>
124 </resources>
125 </configuration>
126 </execution>
127 <execution>
128 <id>copy-properties</id>
129 <goals>
130 <goal>copy-resources</goal>
131 </goals><!-- here the phase you need -->
132 <phase>validate</phase>
133 <configuration>
Dan Timoney98ddb132017-09-01 17:40:45 -0400134 <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
Dan Timoney8f773512017-04-24 16:30:26 -0400135 <resources>
136 <resource>
137 <directory>../src/main/properties</directory>
138 <includes>
139 <include>*.properties</include>
140 <include>*.properties.sdnctldb01</include>
141 </includes>
142 <filtering>false</filtering>
143 </resource>
144 </resources>
145 </configuration>
146 </execution>
147 </executions>
148 </plugin>
149 <plugin>
150 <artifactId>exec-maven-plugin</artifactId>
151 <groupId>org.codehaus.mojo</groupId>
152 <version>1.5.0</version>
153 <executions>
154 <execution>
155 <id>Unzip admportal</id>
156 <phase>generate-sources</phase>
157 <goals>
158 <goal>exec</goal>
159 </goals>
160 <configuration>
161 <executable>/usr/bin/unzip</executable>
162 <arguments>
163 <argument>-d</argument>
Dan Timoney98ddb132017-09-01 17:40:45 -0400164 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400165 <argument>../../admportal/target/*.zip</argument>
166 </arguments>
167 </configuration>
168 </execution>
169
170 <execution>
171 <id>Copy admportal config</id>
172 <phase>generate-sources</phase>
173 <goals>
174 <goal>exec</goal>
175 </goals>
176 <configuration>
177 <executable>/bin/cp</executable>
178 <arguments>
179 <argument>../../admportal/config/admportal.json</argument>
Dan Timoney98ddb132017-09-01 17:40:45 -0400180 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400181 </arguments>
182 </configuration>
183 </execution>
184
185 <execution>
186 <id>Copy admportal config1</id>
187 <phase>generate-sources</phase>
188 <goals>
189 <goal>exec</goal>
190 </goals>
191 <configuration>
192 <executable>/bin/cp</executable>
193 <arguments>
194 <argument>../../admportal/config/admportal.log4js.json</argument>
Dan Timoney98ddb132017-09-01 17:40:45 -0400195 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400196 </arguments>
197 </configuration>
198 </execution>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500199
200
Dan Timoney8f773512017-04-24 16:30:26 -0400201 <execution>
202 <id>change shell permissions</id>
203 <phase>process-sources</phase>
204 <goals>
205 <goal>exec</goal>
206 </goals>
207 <configuration>
208 <executable>/usr/bin/find</executable>
209 <arguments>
Dan Timoney98ddb132017-09-01 17:40:45 -0400210 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400211 <argument>-name</argument>
212 <argument>*.sh</argument>
213 <argument>-exec</argument>
214 <argument>chmod</argument>
215 <argument>+x</argument>
216 <argument>{}</argument>
217 <argument>;</argument>
218 </arguments>
219 </configuration>
220 </execution>
221 </executions>
222 </plugin>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500223
224
Dan Timoney8f773512017-04-24 16:30:26 -0400225 </plugins>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500226
Dan Timoney8f773512017-04-24 16:30:26 -0400227 </build>
228 <organization>
229 <name>openECOMP</name>
230 </organization>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500231</project>