58ac368d0398fb99fca1b896f2ce1012820af15f
[so.git] / packages / docker / pom.xml
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3         <modelVersion>4.0.0</modelVersion>
4
5         <parent>
6                 <groupId>org.openecomp.mso</groupId>
7                 <artifactId>packages</artifactId>
8                 <version>1.1.0-SNAPSHOT</version>
9         </parent>
10
11         <packaging>pom</packaging>
12         <groupId>org.openecomp.mso</groupId>
13         <artifactId>docker</artifactId>
14
15         <name>MSO Docker Deliveries</name>
16         <description>OpenECOMP MSO Docker Deliveries</description>
17
18         <properties>
19                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20                 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
21                 <!-- If the maven profile "docker" is specified the parameter -Dmso.git.url=<MsoGitRepo> must be provided
22                      i.e: mvn clean install -P docker -Dmso.git.url=https://gerrit.onap.org/r-->
23                 <mso.git.url>${env.GIT_NO_PROJECT}</mso.git.url>
24                 <mso.project.version>${project.version}</mso.project.version>
25         </properties>
26
27         <build>
28                 <finalName>${project.artifactId}-${project.version}</finalName>
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['mso.project.version'];
42                         def versionArray;
43                         if ( project.properties['mso.project.version'] != null ) {
44                             versionArray = project.properties['mso.project.version'].split('\\.');
45                         } 
46
47                         if ( project.properties['mso.project.version'].endsWith("-SNAPSHOT") ) {
48                             project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-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                         <plugin>
60                                 <groupId>org.apache.maven.plugins</groupId>
61                                 <artifactId>maven-scm-plugin</artifactId>
62                                 <version>1.9.5</version>
63                                 <executions>
64                                         <execution>
65                                                 <id>chef-repo-checkout</id>
66                                                 <goals>
67                                                         <goal>checkout</goal>
68                                                 </goals>
69                                                 <phase>initialize</phase>
70                                                 <configuration>
71                                                         <connectionUrl>scm:git:${mso.git.url}/mso/chef-repo</connectionUrl>
72                                                         <checkoutDirectory>src/main/docker/docker-files/chef-configs/chef-repo</checkoutDirectory>
73                                                         <scmVersion>master</scmVersion>
74                                                         <scmVersionType>branch</scmVersionType>
75                                                         <skipCheckoutIfExists>true</skipCheckoutIfExists>
76                                                         <pushChanges>false</pushChanges>
77                                                 </configuration>
78                                         </execution>
79                                         <execution>
80                                                 <id>mso-config-checkout</id>
81                                                 <goals>
82                                                         <goal>checkout</goal>
83                                                 </goals>
84                                                 <phase>initialize</phase>
85                                                 <configuration>
86                                                         <connectionUrl>scm:git:${mso.git.url}/mso/mso-config</connectionUrl>
87                                                         <checkoutDirectory>src/main/docker/docker-files/chef-configs/mso-config</checkoutDirectory>
88                                                         <scmVersion>master</scmVersion>
89                                                         <scmVersionType>branch</scmVersionType>
90                                                         <skipCheckoutIfExists>true</skipCheckoutIfExists>
91                                                         <pushChanges>false</pushChanges>
92                                                 </configuration>
93                                         </execution>
94                                 </executions>
95                         </plugin>
96                         <plugin>
97                                 <groupId>io.fabric8</groupId>
98                                 <artifactId>docker-maven-plugin</artifactId>
99                                 <version>0.16.5</version>
100
101                                 <configuration>
102                                         <verbose>true</verbose>
103                                         <apiVersion>1.23</apiVersion>
104
105                                         <images>
106                                                 <image>
107                                                         <name>openecomp/jacoco:1.0</name>
108                                                         <alias>jacoco</alias>
109                                                         <build>
110                                                                 <cleanup>try</cleanup>
111                                                                 <dockerFileDir>docker-files</dockerFileDir>
112                                                                 <dockerFile>docker-files/Dockerfile.jacoco</dockerFile>
113
114                                                         </build>
115                                                 </image>
116                                                 <image>
117                                                         <name>openecomp/ubuntu-update:1.0</name>
118                                                         <alias>ubuntu-update</alias>
119                                                         <build>
120
121                                                                 <cleanup>try</cleanup>
122                                                                 <dockerFileDir>docker-files</dockerFileDir>
123                                                                 <dockerFile>docker-files/Dockerfile.ubuntu-16.04-update</dockerFile>
124
125                                                         </build>
126                                                 </image>
127                                                 <image>
128                                                         <name>openecomp/wildfly:1.0</name>
129                                                         <alias>wildfly</alias>
130                                                         <build>
131
132                                                                 <cleanup>try</cleanup>
133                                                                 <dockerFileDir>docker-files</dockerFileDir>
134                                                                 <dockerFile>docker-files/Dockerfile.wildfly-10</dockerFile>
135
136                                                         </build>
137                                                 </image>
138                                                 <image>
139                                                         <name>openecomp/mso-arquillian:%l</name>
140                                                         <alias>mso-arquillian</alias>
141                                                         <build>
142                                                                 <tags>
143                                                                         <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
144                                                                         <tag>${project.docker.latesttag.version}</tag>
145                                                                 </tags>
146                                                                 <cleanup>try</cleanup>
147                                                                 <dockerFileDir>docker-files</dockerFileDir>
148                                                                 <dockerFile>docker-files/Dockerfile.mso-arquillian</dockerFile>
149
150                                                         </build>
151                                                 </image>
152                                                 <image>
153                                                         <name>openecomp/mso:%l</name>
154                                                         <alias>mso</alias>
155                                                         <build>
156                                                                 <tags>
157                                                                         <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
158                                                                         <tag>${project.docker.latesttag.version}</tag>
159                                                                 </tags>
160                                                                 <cleanup>try</cleanup>
161                                                                 <dockerFileDir>docker-files</dockerFileDir>
162                                                                 <dockerFile>docker-files/Dockerfile.mso-chef-final</dockerFile>
163                                                                 <assembly>
164                                                                         <basedir>/</basedir>
165
166                                                                         <user>jboss:jboss:jboss</user>
167                                                                         <basedir>/opt/jboss/wildfly/standalone/deployments</basedir>
168                                                                         <descriptor>../../../../deliveries/src/main/assembly/war-pack/mso-wars.xml</descriptor>
169                                                                 </assembly>
170                                                         </build>
171                                                 </image>
172
173                                         </images>
174                                 </configuration>
175                                 <executions>
176                                         <execution>
177                                                 <id>clean-images</id>
178                                                 <phase>pre-clean</phase>
179                                                 <goals>
180                                                         <goal>remove</goal>
181                                                 </goals>
182                                                 <configuration>
183                                                         <removeAll>true</removeAll>
184                                                         <image>openecomp/mso-arquillian:%l,openecomp/mso:%l</image>
185                                                 </configuration>
186                                         </execution>
187
188                                         <execution>
189                                                 <id>generate-images</id>
190                                                 <phase>generate-sources</phase>
191                                                 <goals>
192                                                         <goal>build</goal>
193                                                 </goals>
194                                         </execution>
195
196                                         <execution>
197                                                 <id>push-images</id>
198                                                 <phase>deploy</phase>
199                                                 <goals>
200                                                         <goal>build</goal>
201                                                         <goal>push</goal>
202                                                 </goals>
203                                                 <configuration>
204                                                         <image>openecomp/mso-arquillian:%l,openecomp/mso:%l,openecomp/jacoco:1.0</image>
205                                                 </configuration>
206                                         </execution>
207                                 </executions>
208
209                         </plugin>
210
211                         <plugin>
212                                 <groupId>org.apache.maven.plugins</groupId>
213                                 <artifactId>maven-deploy-plugin</artifactId>
214                                 <version>2.8</version>
215                                 <configuration>
216                                         <skip>true</skip>
217                                 </configuration>
218                         </plugin>
219                 </plugins>
220         </build>
221
222 </project>