Changes for Fluorine
[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.2.1-SNAPSHOT</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.4.1-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.distribution.version>${project.version}</ccsdk.distribution.version>
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
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>
40                                 println project.properties['ccsdk.project.version'];
41                                 def versionArray;
42                                 if ( project.properties['ccsdk.project.version'] != null ) {
43                                 versionArray = project.properties['ccsdk.project.version'].split('\\.');
44                                 }
45
46                                 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
47                                 {
48                                 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
49                                 } else {
50                                 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
51                                 }
52
53                                 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
54                             </source>
55                         </configuration>
56                     </execution>
57                 </executions>
58             </plugin>
59
60             <plugin>
61                 <artifactId>maven-resources-plugin</artifactId>
62                 <version>2.6</version>
63                 <executions>
64                     <execution>
65                         <id>copy-dockerfile</id>
66                         <goals>
67                             <goal>copy-resources</goal>
68                         </goals><!-- here the phase you need -->
69                         <phase>validate</phase>
70                         <configuration>
71                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
72                             <resources>
73                                 <resource>
74                                     <directory>src/main/docker</directory>
75                                     <includes>
76                                         <include>Dockerfile</include>
77                                     </includes>
78                                     <filtering>true</filtering>
79                                 </resource>
80                             </resources>
81                         </configuration>
82                     </execution>
83
84                     <execution>
85                         <id>copy-scripts</id>
86                         <goals>
87                             <goal>copy-resources</goal>
88                         </goals><!-- here the phase you need -->
89                         <phase>validate</phase>
90                         <configuration>
91                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
92                             <resources>
93                                 <resource>
94                                     <directory>src/main/scripts</directory>
95                                     <includes>
96                                         <include>*</include>
97                                     </includes>
98                                     <filtering>false</filtering>
99                                 </resource>
100                             </resources>
101                         </configuration>
102                     </execution>
103
104                     <execution>
105                         <id>copy-yml</id>
106                         <goals>
107                             <goal>copy-resources</goal>
108                         </goals><!-- here the phase you need -->
109                         <phase>validate</phase>
110                         <configuration>
111                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/Playbooks</outputDirectory>
112                             <resources>
113                                 <resource>
114                                     <directory>src/main/yml</directory>
115                                     <includes>
116                                         <include>*</include>
117                                     </includes>
118                                     <filtering>false</filtering>
119                                 </resource>
120                             </resources>
121                         </configuration>
122                     </execution>
123                 </executions>
124             </plugin>
125
126             <plugin>
127                 <artifactId>exec-maven-plugin</artifactId>
128                 <groupId>org.codehaus.mojo</groupId>
129                 <version>1.5.0</version>
130                 <executions>
131                     <execution>
132                         <id>change python permissions</id>
133                         <phase>process-sources</phase>
134                         <goals>
135                             <goal>exec</goal>
136                         </goals>
137                         <configuration>
138                             <executable>/usr/bin/find</executable>
139                             <arguments>
140                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
141                                 <argument>-name</argument>
142                                 <argument>*.py</argument>
143                                 <argument>-exec</argument>
144                                 <argument>chmod</argument>
145                                 <argument>+x</argument>
146                                 <argument>{}</argument>
147                                 <argument>;</argument>
148                             </arguments>
149                         </configuration>
150                     </execution>
151                         <execution>
152                                                 <id>change shell permissions</id>
153                                                 <phase>process-sources</phase>
154                                                 <goals>
155                                                         <goal>exec</goal>
156                                                 </goals>
157                                                 <configuration>
158                                                         <executable>/usr/bin/find</executable>
159                                                         <arguments>
160                                                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
161                                                                 <argument>-name</argument>
162                                                                 <argument>*.sh</argument>
163                                                                 <argument>-exec</argument>
164                                                                 <argument>chmod</argument>
165                                                                 <argument>+x</argument>
166                                                                 <argument>{}</argument>
167                                                                 <argument>;</argument>
168                                                         </arguments>
169                                                 </configuration>
170                                         </execution>
171                 </executions>
172             </plugin>
173         </plugins>
174     </build>
175
176     <profiles>
177         <profile>
178             <id>docker</id>
179             <build>
180                 <plugins>
181                     <plugin>
182                         <groupId>io.fabric8</groupId>
183                         <artifactId>docker-maven-plugin</artifactId>
184                         <version>0.16.5</version>
185                         <inherited>false</inherited>
186                         <configuration>
187                             <images>
188                                 <image>
189                                     <name>${image.name}</name>
190                                     <build>
191                                         <cleanup>try</cleanup>
192                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
193                                         <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
194                                         <tags>
195                                             <tag>${project.version}</tag>
196                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
197                                             <tag>${project.docker.latesttag.version}</tag>
198                                         </tags>
199                                     </build>
200                                 </image>
201                             </images>
202                         </configuration>
203                         <executions>
204                             <execution>
205                                 <id>generate-images</id>
206                                 <phase>package</phase>
207                                 <goals>
208                                     <goal>build</goal>
209                                 </goals>
210                             </execution>
211
212                             <execution>
213                                 <id>push-images</id>
214                                 <phase>deploy</phase>
215                                 <goals>
216                                     <goal>build</goal>
217                                     <goal>push</goal>
218                                 </goals>
219                             </execution>
220                         </executions>
221                     </plugin>
222                 </plugins>
223             </build>
224         </profile>
225     </profiles>
226     <organization>
227         <name>ONAP</name>
228     </organization>
229 </project>