Effort to reduce image layer and size
[sdnc/oam.git] / installation / sdnc-web / 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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3     <modelVersion>4.0.0</modelVersion>
4
5     <parent>
6         <groupId>org.onap.sdnc.oam</groupId>
7         <artifactId>installation</artifactId>
8         <version>2.2.0-SNAPSHOT</version>
9     </parent>
10
11     <artifactId>installation-sdnc-web</artifactId>
12     <packaging>pom</packaging>
13
14     <name>sdnc-oam :: installation :: ${project.artifactId}</name>
15     <description>Creates SDN Controller WebUI Docker container</description>
16
17     <properties>
18         <base.image.repo>docker.io/bitnami/nginx:1.16-debian-9</base.image.repo>
19         <image.name>onap/sdnc-web-image</image.name>
20         <sdnc.project.version>${project.version}</sdnc.project.version>
21         <sdnc.build.timestamp>${maven.build.timestamp}</sdnc.build.timestamp>
22         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
23         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
24     </properties>
25
26     <dependencies>
27         <dependency>
28             <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
29             <artifactId>sdnr-wt-odlux-installer</artifactId>
30             <version>${ccsdk.features.version}</version>
31             <type>zip</type>
32             <classifier>repo</classifier>
33         </dependency>
34     </dependencies>
35
36     <build>
37         <plugins>
38             <plugin>
39                 <groupId>org.codehaus.groovy.maven</groupId>
40                 <artifactId>gmaven-plugin</artifactId>
41                 <version>1.0</version>
42                 <executions>
43                     <execution>
44                         <phase>validate</phase>
45                         <goals>
46                             <goal>execute</goal>
47                         </goals>
48                         <configuration>
49                             <source>${basedir}/../TagVersion.groovy</source>
50                         </configuration>
51                     </execution>
52                 </executions>
53             </plugin>
54             <plugin>
55                 <artifactId>maven-resources-plugin</artifactId>
56                 <version>2.6</version>
57                 <executions>
58                     <execution>
59                         <id>copy-dockerfile</id>
60                         <goals>
61                             <goal>copy-resources</goal>
62                         </goals>                        <!-- here the phase you need -->
63                         <phase>validate</phase>
64                         <configuration>
65                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
66                             <resources>
67                                 <resource>
68                                     <directory>src/main/docker</directory>
69                                     <includes>
70                                         <include>Dockerfile</include>
71                                     </includes>
72                                     <filtering>true</filtering>
73                                 </resource>
74                             </resources>
75                         </configuration>
76                     </execution>
77                     <execution>
78                         <id>copy-siteconf</id>
79                         <goals>
80                             <goal>copy-resources</goal>
81                         </goals>                        <!-- here the phase you need -->
82                         <phase>validate</phase>
83                         <configuration>
84                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
85                             <resources>
86                                 <resource>
87                                     <directory>src/main/resources</directory>
88                                     <includes>
89                                         <include>*.conf</include>
90                                     </includes>
91                                     <filtering>true</filtering>
92                                 </resource>
93                             </resources>
94                         </configuration>
95                     </execution>
96
97                     <execution>
98                         <id>copy-scripts</id>
99                         <goals>
100                             <goal>copy-resources</goal>
101                         </goals>                        <!-- here the phase you need -->
102                         <phase>validate</phase>
103                         <configuration>
104                             <outputDirectory>${basedir}/target/docker-stage/bin</outputDirectory>
105                             <resources>
106                                 <resource>
107                                     <directory>src/main/scripts</directory>
108                                     <includes>
109                                         <include>*.sh</include>
110                                     </includes>
111                                     <filtering>true</filtering>
112                                 </resource>
113                             </resources>
114                         </configuration>
115                     </execution>
116                 </executions>
117             </plugin>
118             <plugin>
119                 <groupId>org.apache.maven.plugins</groupId>
120                 <artifactId>maven-dependency-plugin</artifactId>
121                 <executions>
122                     <execution>
123                         <id>unpack features</id>
124                         <phase>generate-sources</phase>
125                         <goals>
126                             <goal>unpack-dependencies</goal>
127                         </goals>
128                         <configuration>
129                             <outputDirectory>${basedir}/target/docker-stage/html</outputDirectory>
130                             <excludeTransitive>true</excludeTransitive>
131                             <overWriteReleases>false</overWriteReleases>
132                             <overWriteSnapshots>true</overWriteSnapshots>
133                             <overWriteIfNewer>true</overWriteIfNewer>
134                         </configuration>
135                     </execution>
136                 </executions>
137             </plugin>
138             <plugin>
139                 <groupId>io.fabric8</groupId>
140                 <artifactId>docker-maven-plugin</artifactId>
141                 <version>0.34.0</version>
142                 <inherited>false</inherited>
143                 <configuration>
144                     <images>
145                         <image>
146                             <name>${image.name}</name>
147                             <build>
148                                 <cleanup>try</cleanup>
149                                 <noCache>true</noCache>
150                                 <contextDir>${basedir}/target/docker-stage</contextDir>
151                                 <dockerFile>Dockerfile</dockerFile>
152                                 <tags>
153                                     <tag>${project.docker.latestminortag.version}</tag>
154                                     <tag>${project.docker.latestfulltag.version}</tag>
155                                     <tag>${project.docker.latesttagtimestamp.version}</tag>
156                                 </tags>
157                             </build>
158                         </image>
159                     </images>
160                     <verbose>${docker.verbose}</verbose>
161                     <skipPush>${docker.skip.push}</skipPush>
162                 </configuration>
163                 <executions>
164                     <execution>
165                         <id>build-push-images</id>
166                         <goals>
167                             <goal>build</goal>
168                             <goal>push</goal>
169                         </goals>
170                     </execution>
171                 </executions>
172             </plugin>
173         </plugins>
174     </build>
175 </project>