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