e7fe75d07ce6ff824e6a7ce83af694635d2122f5
[sdnc/oam.git] / installation / ansible-server / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
6         <parent>
7                 <groupId>org.onap.ccsdk.parent</groupId>
8                 <artifactId>odlparent-lite</artifactId>
9                 <version>1.1.3-SNAPSHOT</version>
10         </parent>
11         <modelVersion>4.0.0</modelVersion>
12         <packaging>pom</packaging>
13         <groupId>org.onap.sdnc.oam</groupId>
14         <artifactId>installation-ansible-server</artifactId>
15         <version>1.4.3-SNAPSHOT</version>
16
17         <name>sdnc-oam :: installation :: ${project.artifactId}</name>
18         <description>Creates ansible-server Docker container</description>
19
20         <properties>
21                 <image.name>onap/sdnc-ansible-server-image</image.name>
22                 <sdnc.project.version>${project.version}</sdnc.project.version>
23                 <ccsdk.docker.version>0.3-STAGING-latest</ccsdk.docker.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>
42                                                                 println project.properties['sdnc.project.version'];
43                                                                 def versionArray;
44                                                                 if ( project.properties['sdnc.project.version'] != null ) {
45                                                                     versionArray =
46                                                                     project.properties['sdnc.project.version'].split('\\.');
47                                                                 }
48
49                                                                 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT"))
50                                                                 {
51                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
52                                                                 } else {
53                                                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
54                                                                 }
55
56                                                                 println 'New Tag for docker:' +
57                                                                 project.properties['project.docker.latesttag.version'];
58                                                         </source>
59                                                 </configuration>
60                                         </execution>
61                                 </executions>
62                         </plugin>
63
64                         <plugin>
65                                 <artifactId>maven-resources-plugin</artifactId>
66                                 <version>2.6</version>
67                                 <executions>
68                                         <execution>
69                                                 <id>copy-dockerfile</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</outputDirectory>
76                                                         <resources>
77                                                                 <resource>
78                                                                         <directory>src/main/docker</directory>
79                                                                         <includes>
80                                                                                 <include>Dockerfile</include>
81                                                                         </includes>
82                                                                         <filtering>true</filtering>
83                                                                 </resource>
84                                                         </resources>
85                                                 </configuration>
86                                         </execution>
87
88                                         <execution>
89                                                 <id>copy-yml</id>
90                                                 <goals>
91                                                         <goal>copy-resources</goal>
92                                                 </goals><!-- here the phase you need -->
93                                                 <phase>validate</phase>
94                                                 <configuration>
95                                                         <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/Playbooks</outputDirectory>
96                                                         <resources>
97                                                                 <resource>
98                                                                         <directory>src/main/yml</directory>
99                                                                         <includes>
100                                                                                 <include>*</include>
101                                                                         </includes>
102                                                                         <filtering>false</filtering>
103                                                                 </resource>
104                                                         </resources>
105                                                 </configuration>
106                                         </execution>
107                                 </executions>
108                         </plugin>
109                 </plugins>
110         </build>
111
112         <profiles>
113                 <profile>
114                         <id>docker</id>
115                         <build>
116                                 <plugins>
117                                         <plugin>
118                                                 <groupId>io.fabric8</groupId>
119                                                 <artifactId>docker-maven-plugin</artifactId>
120                                                 <version>0.16.5</version>
121                                                 <inherited>false</inherited>
122                                                 <configuration>
123                                                         <images>
124                                                                 <image>
125                                                                         <name>${image.name}</name>
126                                                                         <build>
127                                                                                 <cleanup>try</cleanup>
128                                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
129                                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
130                                                                                 <tags>
131                                                                                         <tag>${project.version}</tag>
132                                                                                         <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
133                                                                                         <tag>${project.docker.latesttag.version}</tag>
134                                                                                 </tags>
135                                                                         </build>
136                                                                 </image>
137                                                         </images>
138                                                 </configuration>
139                                                 <executions>
140                                                         <execution>
141                                                                 <id>generate-images</id>
142                                                                 <phase>package</phase>
143                                                                 <goals>
144                                                                         <goal>build</goal>
145                                                                 </goals>
146                                                         </execution>
147
148                                                         <execution>
149                                                                 <id>push-images</id>
150                                                                 <phase>deploy</phase>
151                                                                 <goals>
152                                                                         <goal>build</goal>
153                                                                         <goal>push</goal>
154                                                                 </goals>
155                                                         </execution>
156                                                 </executions>
157                                         </plugin>
158                                 </plugins>
159                         </build>
160                 </profile>
161         </profiles>
162         <organization>
163                 <name>ONAP</name>
164         </organization>
165 </project>