Adding noCache docker build argument
[ccsdk/distribution.git] / ansible-server / 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-root</artifactId>
8         <version>1.2.0-SNAPSHOT</version>
9     </parent>
10
11     <groupId>org.onap.ccsdk.distribution</groupId>
12     <artifactId>ansible-server</artifactId>
13     <version>1.2.0-SNAPSHOT</version>
14     <packaging>pom</packaging>
15
16     <name>ccsdk-distribution :: ${project.artifactId}</name>
17     <description>Creates ansible-server Docker container</description>
18     <organization>
19         <name>ONAP</name>
20     </organization>
21
22     <properties>
23         <image.name>onap/ccsdk-ansible-server-image</image.name>
24                 <ccsdk.project.version>${project.version}</ccsdk.project.version>
25                 <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
26                 <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
27                 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
28         <docker.verbose>true</docker.verbose>
29         <docker.skip.push>false</docker.skip.push>
30     </properties>
31
32     <build>
33         <plugins>
34             <plugin>
35                 <groupId>org.codehaus.groovy.maven</groupId>
36                 <artifactId>gmaven-plugin</artifactId>
37                 <version>1.0</version>
38                 <executions>
39                     <execution>
40                         <phase>validate</phase>
41                         <goals>
42                             <goal>execute</goal>
43                         </goals>
44                         <configuration>
45                             <source>${basedir}/../src/main/scripts/TagVersion.groovy</source>
46                         </configuration>
47                     </execution>
48                 </executions>
49             </plugin>
50
51             <plugin>
52                 <artifactId>maven-resources-plugin</artifactId>
53                 <version>2.6</version>
54                 <executions>
55                     <execution>
56                         <id>copy-dockerfile</id>
57                         <goals>
58                             <goal>copy-resources</goal>
59                         </goals><!-- here the phase you need -->
60                         <phase>validate</phase>
61                         <configuration>
62                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
63                             <resources>
64                                 <resource>
65                                     <directory>src/main</directory>
66                                     <includes>
67                                         <include>**/*</include>
68                                     </includes>
69                                     <filtering>false</filtering>
70                                 </resource>
71                             </resources>
72                         </configuration>
73                     </execution>
74                 </executions>
75             </plugin>
76
77             <plugin>
78                 <groupId>org.codehaus.mojo</groupId>
79                 <artifactId>exec-maven-plugin</artifactId>
80                 <version>1.5.0</version>
81                 <executions>
82                     <execution>
83                         <id>change python permissions</id>
84                         <phase>process-sources</phase>
85                         <goals>
86                             <goal>exec</goal>
87                         </goals>
88                         <configuration>
89                             <executable>/usr/bin/find</executable>
90                             <arguments>
91                                 <argument>${basedir}/target/docker-stage/ansible-server</argument>
92                                 <argument>-name</argument>
93                                 <argument>*.py</argument>
94                                 <argument>-exec</argument>
95                                 <argument>chmod</argument>
96                                 <argument>+x</argument>
97                                 <argument>{}</argument>
98                                 <argument>;</argument>
99                             </arguments>
100                         </configuration>
101                     </execution>
102                     <execution>
103                         <id>change shell permissions</id>
104                         <phase>process-sources</phase>
105                         <goals>
106                             <goal>exec</goal>
107                         </goals>
108                         <configuration>
109                             <executable>/usr/bin/find</executable>
110                             <arguments>
111                                 <argument>${basedir}/target/docker-stage/ansible-server</argument>
112                                 <argument>-name</argument>
113                                 <argument>*.sh</argument>
114                                 <argument>-exec</argument>
115                                 <argument>chmod</argument>
116                                 <argument>+x</argument>
117                                 <argument>{}</argument>
118                                 <argument>;</argument>
119                             </arguments>
120                         </configuration>
121                     </execution>
122                 </executions>
123             </plugin>
124         </plugins>
125     </build>
126
127     <profiles>
128         <profile>
129             <id>docker</id>
130             <build>
131                 <plugins>
132                     <plugin>
133                         <groupId>io.fabric8</groupId>
134                         <artifactId>docker-maven-plugin</artifactId>
135                         <version>0.34.0</version>
136                         <inherited>false</inherited>
137                         <configuration>
138                             <images>
139                                 <image>
140                                     <name>${image.name}</name>
141                                     <build>
142                                         <cleanup>try</cleanup>
143                                         <noCache>true</noCache>
144                                         <contextDir>${basedir}/target/docker-stage</contextDir>
145                                         <dockerFile>Dockerfile</dockerFile>
146                                         <tags>
147                                             <tag>${project.docker.latestminortag.version}</tag>
148                                             <tag>${project.docker.latestfulltag.version}</tag>
149                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
150                                         </tags>
151                                     </build>
152                                 </image>
153                             </images>
154                             <verbose>${docker.verbose}</verbose>
155                             <skipPush>${docker.skip.push}</skipPush>
156                         </configuration>
157                         <executions>
158                             <execution>
159                                 <id>build-push-images</id>
160                                 <goals>
161                                     <goal>build</goal>
162                                     <goal>push</goal>
163                                 </goals>
164                             </execution>
165                         </executions>
166                     </plugin>
167                 </plugins>
168             </build>
169         </profile>
170     </profiles>
171 </project>