Merge "link the term memoization"
[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"
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.sdnc.oam</groupId>
13     <artifactId>installation-ansible-server</artifactId>
14     <version>1.5.0-SNAPSHOT</version>
15
16     <name>sdnc-oam :: installation :: ${project.artifactId}</name>
17     <description>Creates ansible-server Docker container</description>
18
19     <properties>
20         <image.name>onap/sdnc-ansible-server-image</image.name>
21         <sdnc.project.version>${project.version}</sdnc.project.version>
22         <ccsdk.docker.version>0.4-STAGING-latest</ccsdk.docker.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['sdnc.project.version'];
42                                 def versionArray;
43                                 if ( project.properties['sdnc.project.version'] != null ) {
44                                 versionArray = 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:' + 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-yml</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/Playbooks</outputDirectory>
93                             <resources>
94                                 <resource>
95                                     <directory>src/main/yml</directory>
96                                     <includes>
97                                         <include>*</include>
98                                     </includes>
99                                     <filtering>false</filtering>
100                                 </resource>
101                             </resources>
102                         </configuration>
103                     </execution>
104                 </executions>
105             </plugin>
106         </plugins>
107     </build>
108
109     <profiles>
110         <profile>
111             <id>docker</id>
112             <build>
113                 <plugins>
114                     <plugin>
115                         <groupId>io.fabric8</groupId>
116                         <artifactId>docker-maven-plugin</artifactId>
117                         <version>0.16.5</version>
118                         <inherited>false</inherited>
119                         <configuration>
120                             <images>
121                                 <image>
122                                     <name>${image.name}</name>
123                                     <build>
124                                         <cleanup>try</cleanup>
125                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
126                                         <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
127                                         <tags>
128                                             <tag>${project.version}</tag>
129                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
130                                             <tag>${project.docker.latesttag.version}</tag>
131                                         </tags>
132                                     </build>
133                                 </image>
134                             </images>
135                         </configuration>
136                         <executions>
137                             <execution>
138                                 <id>generate-images</id>
139                                 <phase>package</phase>
140                                 <goals>
141                                     <goal>build</goal>
142                                 </goals>
143                             </execution>
144
145                             <execution>
146                                 <id>push-images</id>
147                                 <phase>deploy</phase>
148                                 <goals>
149                                     <goal>build</goal>
150                                     <goal>push</goal>
151                                 </goals>
152                             </execution>
153                         </executions>
154                     </plugin>
155                 </plugins>
156             </build>
157         </profile>
158     </profiles>
159     <organization>
160         <name>ONAP</name>
161     </organization>
162 </project>