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