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