Fix docker tags
[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.2.1-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.5.0-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         <sdnc.build.timestamp>${maven.build.timestamp}</sdnc.build.timestamp>
25         <ccsdk.docker.version>0.4-STAGING-latest</ccsdk.docker.version>
26         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
27     </properties>
28
29
30     <build>
31         <plugins>
32
33             <plugin>
34                 <groupId>org.codehaus.groovy.maven</groupId>
35                 <artifactId>gmaven-plugin</artifactId>
36                 <executions>
37                     <execution>
38                         <phase>validate</phase>
39                         <goals>
40                             <goal>execute</goal>
41                         </goals>
42                         <configuration>
43                             <source>${basedir}/../TagVersion.groovy</source>
44                         </configuration>
45                     </execution>
46                 </executions>
47             </plugin>
48             <plugin>
49                 <groupId>io.fabric8</groupId>
50                 <artifactId>docker-maven-plugin</artifactId>
51                 <version>0.16.5</version>
52                 <inherited>false</inherited>
53                 <configuration>
54
55                     <images>
56                         <image>
57                             <name>${image.name}</name>
58                             <build>
59                                 <cleanup>try</cleanup>
60                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
61                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
62                                 <tags>
63                                     <tag>${project.docker.latestminortag.version}</tag>
64                                     <tag>${project.docker.latestfulltag.version}</tag>
65                                     <tag>${project.docker.latesttagtimestamp.version}</tag>
66                                 </tags>
67                             </build>
68                         </image>
69                     </images>
70                 </configuration>
71                 <executions>
72                     <execution>
73                         <id>generate-images</id>
74                         <phase>generate-sources</phase>
75                         <goals>
76                             <goal>build</goal>
77                         </goals>
78                     </execution>
79
80                     <execution>
81                         <id>push-images</id>
82                         <phase>deploy</phase>
83                         <goals>
84                             <goal>build</goal>
85                             <goal>push</goal>
86                         </goals>
87                     </execution>
88                 </executions>
89             </plugin>
90
91             <plugin>
92                 <artifactId>maven-resources-plugin</artifactId>
93                 <version>2.6</version>
94                 <executions>
95                     <execution>
96                         <id>copy-dockerfile</id>
97                         <goals>
98                             <goal>copy-resources</goal>
99                         </goals><!-- here the phase you need -->
100                         <phase>validate</phase>
101                         <configuration>
102                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
103                             <resources>
104                                 <resource>
105                                     <directory>src/main/docker</directory>
106                                     <includes>
107                                         <include>Dockerfile</include>
108                                     </includes>
109                                     <filtering>true</filtering>
110                                 </resource>
111                             </resources>
112                         </configuration>
113                     </execution>
114                     <execution>
115                         <id>copy-properties</id>
116                         <goals>
117                             <goal>copy-resources</goal>
118                         </goals><!-- here the phase you need -->
119                         <phase>validate</phase>
120                         <configuration>
121                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory>
122                             <resources>
123                                 <resource>
124                                     <directory>../src/main/properties</directory>
125                                     <includes>
126                                         <include>*.properties</include>
127                                         <include>*.properties.sdnctldb01</include>
128                                     </includes>
129                                     <filtering>false</filtering>
130                                 </resource>
131                             </resources>
132                         </configuration>
133                     </execution>
134                 </executions>
135             </plugin>
136             <plugin>
137                 <artifactId>exec-maven-plugin</artifactId>
138                 <groupId>org.codehaus.mojo</groupId>
139                 <version>1.5.0</version>
140                 <executions>
141                     <execution>
142                         <id>Unzip admportal</id>
143                         <phase>generate-sources</phase>
144                         <goals>
145                             <goal>exec</goal>
146                         </goals>
147                         <configuration>
148                             <executable>/usr/bin/unzip</executable>
149                             <arguments>
150                                 <argument>-d</argument>
151                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
152                                 <argument>../../admportal/target/*.zip</argument>
153                             </arguments>
154                         </configuration>
155                     </execution>
156
157                     <execution>
158                         <id>Copy admportal config</id>
159                         <phase>generate-sources</phase>
160                         <goals>
161                             <goal>exec</goal>
162                         </goals>
163                         <configuration>
164                             <executable>/bin/cp</executable>
165                             <arguments>
166                                 <argument>../../admportal/config/admportal.json</argument>
167                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
168                             </arguments>
169                         </configuration>
170                     </execution>
171
172                     <execution>
173                         <id>Copy admportal config1</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.log4js.json</argument>
182                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</argument>
183                             </arguments>
184                         </configuration>
185                     </execution>
186
187
188                     <execution>
189                         <id>change shell permissions</id>
190                         <phase>process-sources</phase>
191                         <goals>
192                             <goal>exec</goal>
193                         </goals>
194                         <configuration>
195                             <executable>/usr/bin/find</executable>
196                             <arguments>
197                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
198                                 <argument>-name</argument>
199                                 <argument>*.sh</argument>
200                                 <argument>-exec</argument>
201                                 <argument>chmod</argument>
202                                 <argument>+x</argument>
203                                 <argument>{}</argument>
204                                 <argument>;</argument>
205                             </arguments>
206                         </configuration>
207                     </execution>
208                 </executions>
209             </plugin>
210
211
212         </plugins>
213
214     </build>
215     <organization>
216         <name>openECOMP</name>
217     </organization>
218 </project>