blob: ca823723e64664df22493169150c6677a5d87a4a [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>
23 </properties>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050024
25
Dan Timoney8f773512017-04-24 16:30:26 -040026 <build>
27 <plugins>
28
29 <plugin>
30 <groupId>org.codehaus.groovy.maven</groupId>
31 <artifactId>gmaven-plugin</artifactId>
32 <executions>
33 <execution>
34 <phase>validate</phase>
35 <goals>
36 <goal>execute</goal>
37 </goals>
38 <configuration>
39 <source>
40 println project.properties['sdnc.project.version'];
41 def versionArray;
42 if ( project.properties['sdnc.project.version'] != null ) {
Dan Timoney687146e2017-04-25 08:43:30 -040043 versionArray =
44 project.properties['sdnc.project.version'].split('\\.');
Dan Timoney8f773512017-04-24 16:30:26 -040045 }
46
Dan Timoney687146e2017-04-25 08:43:30 -040047 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT")) {
Dan Timoney47020692017-05-15 10:28:02 -040048 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
Dan Timoney8f773512017-04-24 16:30:26 -040049 } else {
Dan Timoney687146e2017-04-25 08:43:30 -040050 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
Dan Timoney8f773512017-04-24 16:30:26 -040051 }
52
53 println 'New Tag for docker:' +
54 project.properties['project.docker.latesttag.version'];
55 </source>
56 </configuration>
57 </execution>
58 </executions>
59 </plugin>
60 <plugin>
61 <groupId>io.fabric8</groupId>
62 <artifactId>docker-maven-plugin</artifactId>
63 <version>0.16.5</version>
64 <inherited>false</inherited>
65 <configuration>
66
67 <images>
68 <image>
69 <name>${image.name}</name>
70 <build>
71 <cleanup>try</cleanup>
72 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
73 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
74 <tags>
Dan Timoney687146e2017-04-25 08:43:30 -040075 <tag>${project.version}</tag>
Dan Timoney8f773512017-04-24 16:30:26 -040076 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
77 <tag>${project.docker.latesttag.version}</tag>
78 </tags>
79 </build>
80 </image>
81 </images>
82 </configuration>
83 <executions>
84 <execution>
85 <id>generate-images</id>
86 <phase>generate-sources</phase>
87 <goals>
88 <goal>build</goal>
89 </goals>
90 </execution>
91
92 <execution>
93 <id>push-images</id>
94 <phase>deploy</phase>
95 <goals>
96 <goal>build</goal>
97 <goal>push</goal>
98 </goals>
99 </execution>
100 </executions>
101 </plugin>
102
103 <plugin>
104 <artifactId>maven-resources-plugin</artifactId>
105 <version>2.6</version>
106 <executions>
107 <execution>
108 <id>copy-dockerfile</id>
109 <goals>
110 <goal>copy-resources</goal>
111 </goals><!-- here the phase you need -->
112 <phase>validate</phase>
113 <configuration>
114 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
115 <resources>
116 <resource>
117 <directory>src/main/docker</directory>
118 <includes>
119 <include>Dockerfile</include>
120 </includes>
121 <filtering>true</filtering>
122 </resource>
123 </resources>
124 </configuration>
125 </execution>
126 <execution>
127 <id>copy-properties</id>
128 <goals>
129 <goal>copy-resources</goal>
130 </goals><!-- here the phase you need -->
131 <phase>validate</phase>
132 <configuration>
Dan Timoney98ddb132017-09-01 17:40:45 -0400133 <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
Dan Timoney8f773512017-04-24 16:30:26 -0400134 <resources>
135 <resource>
136 <directory>../src/main/properties</directory>
137 <includes>
138 <include>*.properties</include>
139 <include>*.properties.sdnctldb01</include>
140 </includes>
141 <filtering>false</filtering>
142 </resource>
143 </resources>
144 </configuration>
145 </execution>
146 </executions>
147 </plugin>
148 <plugin>
149 <artifactId>exec-maven-plugin</artifactId>
150 <groupId>org.codehaus.mojo</groupId>
151 <version>1.5.0</version>
152 <executions>
153 <execution>
154 <id>Unzip admportal</id>
155 <phase>generate-sources</phase>
156 <goals>
157 <goal>exec</goal>
158 </goals>
159 <configuration>
160 <executable>/usr/bin/unzip</executable>
161 <arguments>
162 <argument>-d</argument>
Dan Timoney98ddb132017-09-01 17:40:45 -0400163 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400164 <argument>../../admportal/target/*.zip</argument>
165 </arguments>
166 </configuration>
167 </execution>
168
169 <execution>
170 <id>Copy admportal config</id>
171 <phase>generate-sources</phase>
172 <goals>
173 <goal>exec</goal>
174 </goals>
175 <configuration>
176 <executable>/bin/cp</executable>
177 <arguments>
178 <argument>../../admportal/config/admportal.json</argument>
Dan Timoney98ddb132017-09-01 17:40:45 -0400179 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400180 </arguments>
181 </configuration>
182 </execution>
183
184 <execution>
185 <id>Copy admportal config1</id>
186 <phase>generate-sources</phase>
187 <goals>
188 <goal>exec</goal>
189 </goals>
190 <configuration>
191 <executable>/bin/cp</executable>
192 <arguments>
193 <argument>../../admportal/config/admportal.log4js.json</argument>
Dan Timoney98ddb132017-09-01 17:40:45 -0400194 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400195 </arguments>
196 </configuration>
197 </execution>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500198
199
Dan Timoney8f773512017-04-24 16:30:26 -0400200 <execution>
201 <id>change shell permissions</id>
202 <phase>process-sources</phase>
203 <goals>
204 <goal>exec</goal>
205 </goals>
206 <configuration>
207 <executable>/usr/bin/find</executable>
208 <arguments>
Dan Timoney98ddb132017-09-01 17:40:45 -0400209 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
Dan Timoney8f773512017-04-24 16:30:26 -0400210 <argument>-name</argument>
211 <argument>*.sh</argument>
212 <argument>-exec</argument>
213 <argument>chmod</argument>
214 <argument>+x</argument>
215 <argument>{}</argument>
216 <argument>;</argument>
217 </arguments>
218 </configuration>
219 </execution>
220 </executions>
221 </plugin>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500222
223
Dan Timoney8f773512017-04-24 16:30:26 -0400224 </plugins>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500225
Dan Timoney8f773512017-04-24 16:30:26 -0400226 </build>
227 <organization>
228 <name>openECOMP</name>
229 </organization>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500230</project>