Roll to next snapshot
[sdnc/oam.git] / installation / admportal / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
6         <parent>
7                 <groupId>org.onap.ccsdk.parent</groupId>
8                 <artifactId>odlparent-lite</artifactId>
9                 <version>1.1.3-SNAPSHOT</version>
10         </parent>
11
12         <modelVersion>4.0.0</modelVersion>
13         <packaging>pom</packaging>
14         <groupId>org.onap.sdnc.oam</groupId>
15         <artifactId>installation-admportal</artifactId>
16         <version>1.4.3-SNAPSHOT</version>
17
18         <name>sdnc-oam :: installation :: ${project.artifactId}</name>
19         <description>Creates admportal Docker container</description>
20
21         <properties>
22                 <image.name>onap/admportal-sdnc-image</image.name>
23                 <sdnc.project.version>${project.version}</sdnc.project.version>
24                 <ccsdk.docker.version>0.3-STAGING-latest</ccsdk.docker.version>
25                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
26         </properties>
27
28
29         <build>
30                 <plugins>
31
32                         <plugin>
33                                 <groupId>org.codehaus.groovy.maven</groupId>
34                                 <artifactId>gmaven-plugin</artifactId>
35                                 <executions>
36                                         <execution>
37                                                 <phase>validate</phase>
38                                                 <goals>
39                                                         <goal>execute</goal>
40                                                 </goals>
41                                                 <configuration>
42                                                         <source>
43                                                                 println project.properties['sdnc.project.version'];
44                                                                 def versionArray;
45                                                                 if ( project.properties['sdnc.project.version'] != null ) {
46                                                                     versionArray =
47                                                                     project.properties['sdnc.project.version'].split('\\.');
48                                                                 }
49
50                                                                 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT"))
51                                                                 {
52                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
53                                                                 } else {
54                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
55                                                                 }
56
57                                                                 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
58                                                         </source>
59                                                 </configuration>
60                                         </execution>
61                                 </executions>
62                         </plugin>
63                         <plugin>
64                                 <groupId>io.fabric8</groupId>
65                                 <artifactId>docker-maven-plugin</artifactId>
66                                 <version>0.16.5</version>
67                                 <inherited>false</inherited>
68                                 <configuration>
69
70                                         <images>
71                                                 <image>
72                                                         <name>${image.name}</name>
73                                                         <build>
74                                                                 <cleanup>try</cleanup>
75                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
76                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
77                                                                 <tags>
78                                                                         <tag>${project.version}</tag>
79                                                                         <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
80                                                                         <tag>${project.docker.latesttag.version}</tag>
81                                                                 </tags>
82                                                         </build>
83                                                 </image>
84                                         </images>
85                                 </configuration>
86                                 <executions>
87                                         <execution>
88                                                 <id>generate-images</id>
89                                                 <phase>generate-sources</phase>
90                                                 <goals>
91                                                         <goal>build</goal>
92                                                 </goals>
93                                         </execution>
94
95                                         <execution>
96                                                 <id>push-images</id>
97                                                 <phase>deploy</phase>
98                                                 <goals>
99                                                         <goal>build</goal>
100                                                         <goal>push</goal>
101                                                 </goals>
102                                         </execution>
103                                 </executions>
104                         </plugin>
105
106                         <plugin>
107                                 <artifactId>maven-resources-plugin</artifactId>
108                                 <version>2.6</version>
109                                 <executions>
110                                         <execution>
111                                                 <id>copy-dockerfile</id>
112                                                 <goals>
113                                                         <goal>copy-resources</goal>
114                                                 </goals><!-- here the phase you need -->
115                                                 <phase>validate</phase>
116                                                 <configuration>
117                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
118                                                         <resources>
119                                                                 <resource>
120                                                                         <directory>src/main/docker</directory>
121                                                                         <includes>
122                                                                                 <include>Dockerfile</include>
123                                                                         </includes>
124                                                                         <filtering>true</filtering>
125                                                                 </resource>
126                                                         </resources>
127                                                 </configuration>
128                                         </execution>
129                                         <execution>
130                                                 <id>copy-properties</id>
131                                                 <goals>
132                                                         <goal>copy-resources</goal>
133                                                 </goals><!-- here the phase you need -->
134                                                 <phase>validate</phase>
135                                                 <configuration>
136                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
137                                                         <resources>
138                                                                 <resource>
139                                                                         <directory>../src/main/properties</directory>
140                                                                         <includes>
141                                                                                 <include>*.properties</include>
142                                                                                 <include>*.properties.sdnctldb01</include>
143                                                                         </includes>
144                                                                         <filtering>false</filtering>
145                                                                 </resource>
146                                                         </resources>
147                                                 </configuration>
148                                         </execution>
149                                 </executions>
150                         </plugin>
151                         <plugin>
152                                 <artifactId>exec-maven-plugin</artifactId>
153                                 <groupId>org.codehaus.mojo</groupId>
154                                 <version>1.5.0</version>
155                                 <executions>
156                                         <execution>
157                                                 <id>Unzip admportal</id>
158                                                 <phase>generate-sources</phase>
159                                                 <goals>
160                                                         <goal>exec</goal>
161                                                 </goals>
162                                                 <configuration>
163                                                         <executable>/usr/bin/unzip</executable>
164                                                         <arguments>
165                                                                 <argument>-d</argument>
166                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
167                                                                 <argument>../../admportal/target/*.zip</argument>
168                                                         </arguments>
169                                                 </configuration>
170                                         </execution>
171
172                                         <execution>
173                                                 <id>Copy admportal config</id>
174                                                 <phase>generate-sources</phase>
175                                                 <goals>
176                                                         <goal>exec</goal>
177                                                 </goals>
178                                                 <configuration>
179                                                         <executable>/bin/cp</executable>
180                                                         <arguments>
181                                                                 <argument>../../admportal/config/admportal.json</argument>
182                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
183                                                         </arguments>
184                                                 </configuration>
185                                         </execution>
186
187                                         <execution>
188                                                 <id>Copy admportal config1</id>
189                                                 <phase>generate-sources</phase>
190                                                 <goals>
191                                                         <goal>exec</goal>
192                                                 </goals>
193                                                 <configuration>
194                                                         <executable>/bin/cp</executable>
195                                                         <arguments>
196                                                                 <argument>../../admportal/config/admportal.log4js.json</argument>
197                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
198                                                         </arguments>
199                                                 </configuration>
200                                         </execution>
201
202
203                                         <execution>
204                                                 <id>change shell permissions</id>
205                                                 <phase>process-sources</phase>
206                                                 <goals>
207                                                         <goal>exec</goal>
208                                                 </goals>
209                                                 <configuration>
210                                                         <executable>/usr/bin/find</executable>
211                                                         <arguments>
212                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
213                                                                 <argument>-name</argument>
214                                                                 <argument>*.sh</argument>
215                                                                 <argument>-exec</argument>
216                                                                 <argument>chmod</argument>
217                                                                 <argument>+x</argument>
218                                                                 <argument>{}</argument>
219                                                                 <argument>;</argument>
220                                                         </arguments>
221                                                 </configuration>
222                                         </execution>
223                                 </executions>
224                         </plugin>
225
226
227                 </plugins>
228
229         </build>
230         <organization>
231                 <name>openECOMP</name>
232         </organization>
233 </project>