Adding noCache docker build argument
[ccsdk/distribution.git] / opendaylight / sodium / sodium-alpine / 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.ccsdk.distribution</groupId>
7         <artifactId>distribution-odl-sodium</artifactId>
8         <version>1.1.1-SNAPSHOT</version>
9     </parent>
10
11     <artifactId>distribution-odl-sodium-docker</artifactId>
12     <packaging>pom</packaging>
13
14     <name>ccsdk-distribution :: opendaylight :: sodium :: docker</name>
15     <description>Creates OpenDaylight container</description>
16     <organization>
17         <name>ONAP</name>
18     </organization>
19
20     <properties>
21         <image.name>onap/ccsdk-odl-sodium-alpine-image</image.name>
22         <odl.karaf.artifactId>onap-karaf</odl.karaf.artifactId>
23     </properties>
24
25     <build>
26         <plugins>
27
28             <plugin>
29                 <groupId>org.codehaus.groovy.maven</groupId>
30                 <artifactId>gmaven-plugin</artifactId>
31                 <version>1.0</version>
32                 <executions>
33                     <execution>
34                         <phase>validate</phase>
35                         <goals>
36                             <goal>execute</goal>
37                         </goals>
38                         <configuration>
39                             <source>${basedir}/../../../src/main/scripts/TagVersion.groovy</source>
40                         </configuration>
41                     </execution>
42                 </executions>
43             </plugin>
44
45             <plugin>
46                 <groupId>org.apache.maven.plugins</groupId>
47                 <artifactId>maven-dependency-plugin</artifactId>
48                 <version>3.0.0</version>
49                 <executions>
50                     <execution>
51                         <id>get-odl-distribution</id>
52                         <phase>validate</phase>
53                         <goals>
54                             <goal>copy</goal>
55                         </goals>
56                         <configuration>
57                             <artifactItems>
58                                 <artifactItem>
59                                     <groupId>org.opendaylight.integration</groupId>
60                                     <artifactId>${odl.karaf.artifactId}</artifactId>
61                                     <version>${ccsdk.opendaylight.version}</version>
62                                     <type>tar.gz</type>
63
64                                     <overWrite>true</overWrite>
65                                     <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
66                                 </artifactItem>
67                             </artifactItems>
68                             <overWriteReleases>false</overWriteReleases>
69                             <overWriteSnapshots>true</overWriteSnapshots>
70                             <overWriteIfNewer>true</overWriteIfNewer>
71                         </configuration>
72                     </execution>
73                 </executions>
74             </plugin>
75
76             <plugin>
77                 <artifactId>maven-resources-plugin</artifactId>
78                 <version>2.6</version>
79                 <executions>
80                     <execution>
81                         <id>copy-dockerfile</id>
82                         <goals>
83                             <goal>copy-resources</goal>
84                         </goals><!-- here the phase you need -->
85                         <phase>validate</phase>
86                         <configuration>
87                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
88                             <resources>
89                                 <resource>
90                                     <directory>src/main/docker</directory>
91                                     <includes>
92                                         <include>Dockerfile</include>
93                                     </includes>
94                                     <filtering>true</filtering>
95                                 </resource>
96                                 <resource>
97                                     <directory>src/main/odlscripts</directory>
98                                     <includes>
99                                         <include>*</include>
100                                     </includes>
101                                     <filtering>false</filtering>
102                                 </resource>
103                             </resources>
104                         </configuration>
105                     </execution>
106                 </executions>
107             </plugin>
108
109         </plugins>
110     </build>
111
112     <profiles>
113         <profile>
114             <id>docker</id>
115             <build>
116                 <plugins>
117                     <plugin>
118                         <groupId>io.fabric8</groupId>
119                         <artifactId>docker-maven-plugin</artifactId>
120                         <version>0.34.0</version>
121                         <inherited>false</inherited>
122                         <configuration>
123                             <images>
124                                 <image>
125                                     <name>${image.name}</name>
126                                     <build>
127                                         <cleanup>try</cleanup>
128                                         <noCache>true</noCache>
129                                         <contextDir>${basedir}/target/docker-stage</contextDir>
130                                         <dockerFile>Dockerfile</dockerFile>
131                                         <tags>
132                                             <tag>${project.docker.latestminortag.version}</tag>
133                                             <tag>${project.docker.latestfulltag.version}</tag>
134                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
135                                         </tags>
136                                     </build>
137                                 </image>
138                             </images>
139                             <verbose>${docker.verbose}</verbose>
140                             <skipPush>${docker.skip.push}</skipPush>
141                         </configuration>
142                         <executions>
143                             <execution>
144                                 <id>build-push-images</id>
145                                 <goals>
146                                     <goal>build</goal>
147                                     <goal>push</goal>
148                                 </goals>
149                             </execution>
150                         </executions>
151                     </plugin>
152                 </plugins>
153             </build>
154         </profile>
155     </profiles>
156 </project>