Update to use CCSDK version 0.2.4
[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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
5         <parent>
6                 <groupId>org.onap.ccsdk.parent</groupId>
7                 <artifactId>odlparent-lite</artifactId>
8                 <version>1.0.4</version>
9         </parent>
10
11         <modelVersion>4.0.0</modelVersion>
12         <packaging>pom</packaging>
13         <groupId>org.onap.sdnc.oam</groupId>
14         <artifactId>installation-admportal</artifactId>
15         <version>1.3.4-SNAPSHOT</version>
16
17         <name>sdnc-oam :: installation :: ${project.artifactId}</name>
18         <description>Creates admportal Docker container</description>
19
20         <properties>
21                 <image.name>onap/admportal-sdnc-image</image.name>
22                 <sdnc.project.version>${project.version}</sdnc.project.version>
23         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
24         </properties>
25
26
27         <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 ) {
44                                                                         versionArray =
45                                                                         project.properties['sdnc.project.version'].split('\\.');
46                                                                 }
47
48                                                                 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT")) {
49                                                                         project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
50                                                                 } else {
51                                                                         project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
52                                                                 }
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>
76                                                                         <tag>${project.version}</tag>
77                                                                         <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>
134                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
135                                                         <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>
164                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
165                                                                 <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>
180                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
181                                                         </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>
195                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
196                                                         </arguments>
197                                                 </configuration>
198                                         </execution>
199
200
201                                         <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>
210                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
211                                                                 <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>
223
224
225                 </plugins>
226
227         </build>
228         <organization>
229                 <name>openECOMP</name>
230         </organization>
231 </project>