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

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use