e3ca7090aa2ff8aac791f4f191ab30b9132990fd
[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/maven-v4_0_0.xsd">
3
4     <parent>
5         <groupId>org.onap.ccsdk.parent</groupId>
6         <artifactId>odlparent-lite</artifactId>
7         <version>1.1.4</version>
8     </parent>
9     <modelVersion>4.0.0</modelVersion>
10     <packaging>pom</packaging>
11     <groupId>org.onap.ccsdk.distribution</groupId>
12     <artifactId>ansible-server</artifactId>
13     <version>0.3.4-SNAPSHOT</version>
14
15     <name>ccsdk :: distribution :: ${project.artifactId}</name>
16     <description>Creates ansible-server Docker container</description>
17
18     <properties>
19         <image.name>onap/ccsdk-ansible-server-image</image.name>
20         <ccsdk.project.version>${project.version}</ccsdk.project.version>
21                 <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
22         <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
23         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
24     </properties>
25
26
27     <build>
28         <plugins>
29             <plugin>
30                 <groupId>org.codehaus.groovy.maven</groupId>
31                 <artifactId>gmaven-plugin</artifactId>
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                 <artifactId>maven-resources-plugin</artifactId>
47                 <version>2.6</version>
48                 <executions>
49                     <execution>
50                         <id>copy-dockerfile</id>
51                         <goals>
52                             <goal>copy-resources</goal>
53                         </goals><!-- here the phase you need -->
54                         <phase>validate</phase>
55                         <configuration>
56                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
57                             <resources>
58                                 <resource>
59                                     <directory>src/main/docker</directory>
60                                     <includes>
61                                         <include>Dockerfile</include>
62                                     </includes>
63                                     <filtering>true</filtering>
64                                 </resource>
65                             </resources>
66                         </configuration>
67                     </execution>
68                     <execution>
69                         <id>copy-requirements</id>
70                         <goals>
71                             <goal>copy-resources</goal>
72                         </goals><!-- here the phase you need -->
73                         <phase>validate</phase>
74                         <configuration>
75                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
76                             <resources>
77                                 <resource>
78                                     <directory>src/main/resources</directory>
79                                     <includes>
80                                         <include>requirements.txt</include>
81                                     </includes>
82                                     <filtering>false</filtering>
83                                 </resource>
84                             </resources>
85                         </configuration>
86                     </execution>
87                     <execution>
88                         <id>copy-scripts</id>
89                         <goals>
90                             <goal>copy-resources</goal>
91                         </goals><!-- here the phase you need -->
92                         <phase>validate</phase>
93                         <configuration>
94                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
95                             <resources>
96                                 <resource>
97                                     <directory>src/main/scripts</directory>
98                                     <includes>
99                                         <include>*</include>
100                                     </includes>
101                                     <filtering>false</filtering>
102                                 </resource>
103                             </resources>
104                         </configuration>
105                     </execution>
106
107                     <execution>
108                         <id>copy-yml</id>
109                         <goals>
110                             <goal>copy-resources</goal>
111                         </goals><!-- here the phase you need -->
112                         <phase>validate</phase>
113                         <configuration>
114                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/Playbooks</outputDirectory>
115                             <resources>
116                                 <resource>
117                                     <directory>src/main/yml</directory>
118                                     <includes>
119                                         <include>*</include>
120                                     </includes>
121                                     <filtering>false</filtering>
122                                 </resource>
123                             </resources>
124                         </configuration>
125                     </execution>
126                 </executions>
127             </plugin>
128
129             <plugin>
130                 <artifactId>exec-maven-plugin</artifactId>
131                 <groupId>org.codehaus.mojo</groupId>
132                 <version>1.5.0</version>
133                 <executions>
134                     <execution>
135                         <id>change python permissions</id>
136                         <phase>process-sources</phase>
137                         <goals>
138                             <goal>exec</goal>
139                         </goals>
140                         <configuration>
141                             <executable>/usr/bin/find</executable>
142                             <arguments>
143                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
144                                 <argument>-name</argument>
145                                 <argument>*.py</argument>
146                                 <argument>-exec</argument>
147                                 <argument>chmod</argument>
148                                 <argument>+x</argument>
149                                 <argument>{}</argument>
150                                 <argument>;</argument>
151                             </arguments>
152                         </configuration>
153                     </execution>
154                         <execution>
155                                                 <id>change shell permissions</id>
156                                                 <phase>process-sources</phase>
157                                                 <goals>
158                                                         <goal>exec</goal>
159                                                 </goals>
160                                                 <configuration>
161                                                         <executable>/usr/bin/find</executable>
162                                                         <arguments>
163                                                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
164                                                                 <argument>-name</argument>
165                                                                 <argument>*.sh</argument>
166                                                                 <argument>-exec</argument>
167                                                                 <argument>chmod</argument>
168                                                                 <argument>+x</argument>
169                                                                 <argument>{}</argument>
170                                                                 <argument>;</argument>
171                                                         </arguments>
172                                                 </configuration>
173                                         </execution>
174                 </executions>
175             </plugin>
176         </plugins>
177     </build>
178
179     <profiles>
180         <profile>
181             <id>docker</id>
182             <build>
183                 <plugins>
184                     <plugin>
185                         <groupId>io.fabric8</groupId>
186                         <artifactId>docker-maven-plugin</artifactId>
187                         <version>0.16.5</version>
188                         <inherited>false</inherited>
189                         <configuration>
190                             <images>
191                                 <image>
192                                     <name>${image.name}</name>
193                                     <build>
194                                         <cleanup>try</cleanup>
195                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
196                                         <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
197                                         <tags>
198                                                                                         <tag>${project.docker.latestminortag.version}</tag>
199                                                                                         <tag>${project.docker.latestfulltag.version}</tag>
200                                                                                         <tag>${project.docker.latesttagtimestamp.version}</tag>
201                                         </tags>
202                                     </build>
203                                 </image>
204                             </images>
205                         </configuration>
206                         <executions>
207                             <execution>
208                                 <id>generate-images</id>
209                                 <phase>package</phase>
210                                 <goals>
211                                     <goal>build</goal>
212                                 </goals>
213                             </execution>
214
215                             <execution>
216                                 <id>push-images</id>
217                                 <phase>deploy</phase>
218                                 <goals>
219                                     <goal>build</goal>
220                                     <goal>push</goal>
221                                 </goals>
222                             </execution>
223                         </executions>
224                     </plugin>
225                 </plugins>
226             </build>
227         </profile>
228     </profiles>
229     <organization>
230         <name>ONAP</name>
231     </organization>
232 </project>