d0131e4e557abb791488c185fe8e87682d983487
[sdc.git] / sdc-os-chef / 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
4         <modelVersion>4.0.0</modelVersion>
5
6         <artifactId>sdc-os-chef</artifactId>
7
8         <parent>
9                 <groupId>org.openecomp.sdc</groupId>
10                 <artifactId>sdc-main</artifactId>
11                 <version>1.1.0-SNAPSHOT</version>
12         </parent>
13
14
15         <properties>
16                 <docker.tag>${project.version}-${maven.build.timestamp}</docker.tag>
17                 <docker.latest.tag>${project.version}-latest</docker.latest.tag>
18         </properties>
19
20         <build>
21                 <plugins>
22                         <plugin>
23                                 <artifactId>maven-clean-plugin</artifactId>
24                                 <version>3.0.0</version>
25                                 <executions>
26                                         <execution>
27                                                 <id>clean.tosca.chef.os.folder</id>
28                                                 <phase>clean</phase>
29                                                 <goals>
30                                                         <goal>clean</goal>
31                                                 </goals>
32                                                 <configuration>
33                                                         <filesets>
34                                                                 <fileset>
35                                                                         <directory>${project.basedir}\sdc-cassandra\chef-repo\cookbooks\cassandra-actions\attributes\</directory>
36                                                                         <followSymlinks>false</followSymlinks>
37                                                                         <includes>
38                                                                                 <include>**/default.rb</include>
39                                                                         </includes>
40                                                                 </fileset>
41                                                         </filesets>
42                                                 </configuration>
43                                         </execution>
44                                 </executions>
45                         </plugin>
46                         <plugin>
47                                 <groupId>ru.yaal.maven</groupId>
48                                 <artifactId>write-text-files-maven-plugin</artifactId>
49                                 <version>1.1</version>
50                                 <configuration>
51                                         <charset>UTF-8</charset>
52                                         <files>
53                                                 <file>
54                                                         <path>${project.basedir}\sdc-cassandra\chef-repo\cookbooks\cassandra-actions\attributes\default.rb</path>
55                                                         <lines>
56                                                                 <line>normal['version'] = "${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</line>
57                                                         </lines>
58                                                 </file>
59                                         </files>
60                                 </configuration>
61                                 <executions>
62                                         <execution>
63                                                 <id>write-text-files</id>
64                                                 <phase>prepare-package</phase>
65                                                 <goals>
66                                                         <goal>write-text-files</goal>
67                                                 </goals>
68                                         </execution>
69                                 </executions>
70                         </plugin>
71                 </plugins>
72         </build>
73
74         <profiles>
75                 <profile>
76                         <id>docker-staging</id>
77                         <properties>
78                                 <docker.tag>${project.version}-STAGING-${maven.build.timestamp}</docker.tag>
79                                 <docker.latest.tag>${project.version}-STAGING-latest</docker.latest.tag>
80                         </properties>
81                 </profile>
82
83                 <profile>
84                         <id>docker</id>
85                         <activation>
86                                 <activeByDefault>false</activeByDefault>
87                         </activation>
88                         <build>
89                                 <plugins>
90                                         <plugin>
91                                                 <artifactId>maven-resources-plugin</artifactId>
92                                                 <version>3.0.2</version>
93                                                 <executions>
94                                                         <execution>
95                                                                 <id>copy-resources-apidocs</id>
96                                                                 <phase>validate</phase>
97                                                                 <goals>
98                                                                         <goal>copy-resources</goal>
99                                                                 </goals>
100                                                                 <configuration>
101                                                                         <outputDirectory>${basedir}/sdc-backend</outputDirectory>
102                                                                         <resources>
103                                                                                 <resource>
104                                                                                         <directory>${project.parent.basedir}/openecomp-be/tools/swagger-ui/api-docs</directory>
105                                                                                         <includes>
106                                                                                                 <include>api-docs.war</include>
107                                                                                         </includes>
108                                                                                 </resource>
109                                                                         </resources>
110                                                                 </configuration>
111                                                         </execution>
112                                                         <execution>
113                                                                 <id>copy-resources-be</id>
114                                                                 <phase>validate</phase>
115                                                                 <goals>
116                                                                         <goal>copy-resources</goal>
117                                                                 </goals>
118                                                                 <configuration>
119                                                                         <outputDirectory>${basedir}/sdc-backend</outputDirectory>
120                                                                         <resources>
121                                                                                 <resource>
122                                                                                         <directory>${project.parent.basedir}/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/target</directory>
123                                                                                         <includes>
124                                                                                                 <include>onboarding-be-${project.version}.war</include>
125                                                                                         </includes>
126                                                                                 </resource>
127                                                                         </resources>
128                                                                 </configuration>
129                                                         </execution>
130                                                         <execution>
131                                                                 <id>copy-resources-fe</id>
132                                                                 <phase>validate</phase>
133                                                                 <goals>
134                                                                         <goal>copy-resources</goal>
135                                                                 </goals>
136                                                                 <configuration>
137                                                                         <outputDirectory>${basedir}/sdc-frontend</outputDirectory>
138                                                                         <resources>
139                                                                                 <resource>
140                                                                                         <directory>${project.parent.basedir}/openecomp-ui/target</directory>
141                                                                                         <includes>
142                                                                                                 <include>onboarding-fe-${project.version}.war</include>
143                                                                                         </includes>
144                                                                                 </resource>
145                                                                         </resources>
146                                                                 </configuration>
147                                                         </execution>
148                                                 </executions>
149                                         </plugin>
150
151
152
153                                         <plugin>
154                                                 <groupId>io.fabric8</groupId>
155                                                 <artifactId>docker-maven-plugin</artifactId>
156                                                 <version>0.19.1</version>
157
158                                                 <configuration>
159                                                         <verbose>true</verbose>
160                                                         <apiVersion>1.23</apiVersion>
161
162                                                         <images>
163
164                                                                 <!-- Build backend image -->
165                                                                 <image>
166                                                                         <name>openecomp/sdc-backend</name>
167                                                                         <alias>sdc-backend</alias>
168                                                                         <build>
169                                                                                 <cleanup>try</cleanup>
170                                                                                 <dockerFileDir>${project.basedir}/sdc-backend</dockerFileDir>
171                                                                                 <tags>
172                                                                                         <tag>${docker.tag}</tag>
173                                                                                         <tag>${docker.latest.tag}</tag>
174                                                                                         <tag>1.1-STAGING-latest</tag>
175                                                                                 </tags>
176                                                                         </build>
177                                                                 </image>
178
179                                                                 <!-- Build frontend image -->
180                                                                 <image>
181                                                                         <name>openecomp/sdc-frontend</name>
182                                                                         <alias>sdc-frontend</alias>
183                                                                         <build>
184                                                                                 <cleanup>try</cleanup>
185                                                                                 <dockerFileDir>${project.basedir}/sdc-frontend</dockerFileDir>
186                                                                                 <tags>
187                                                                                         <tag>${docker.tag}</tag>
188                                                                                         <tag>${docker.latest.tag}</tag>
189                                                                                         <tag>1.1-STAGING-latest</tag>
190                                                                                 </tags>
191                                                                         </build>
192                                                                 </image>
193
194                                                                 <!-- Build elastic search image -->
195                                                                 <image>
196                                                                         <name>openecomp/sdc-elasticsearch</name>
197                                                                         <alias>sdc-elasticsearch</alias>
198                                                                         <build>
199                                                                                 <cleanup>try</cleanup>
200                                                                                 <dockerFileDir>${project.basedir}/sdc-elasticsearch</dockerFileDir>
201                                                                                 <tags>
202                                                                                         <tag>${docker.tag}</tag>
203                                                                                         <tag>${docker.latest.tag}</tag>
204                                                                                         <tag>1.1-STAGING-latest</tag>
205                                                                                 </tags>
206                                                                         </build>
207                                                                 </image>
208
209                                                                 <!-- Build kibana image -->
210                                                                 <image>
211                                                                         <name>openecomp/sdc-kibana</name>
212                                                                         <alias>sdc-kibana</alias>
213                                                                         <build>
214                                                                                 <cleanup>try</cleanup>
215                                                                                 <dockerFileDir>${project.basedir}/sdc-kibana</dockerFileDir>
216                                                                                 <tags>
217                                                                                         <tag>${docker.tag}</tag>
218                                                                                         <tag>${docker.latest.tag}</tag>
219                                                                                         <tag>1.1-STAGING-latest</tag>
220                                                                                 </tags>
221                                                                         </build>
222                                                                 </image>
223
224                                                                 <!-- Build cassandra image -->
225                                                                 <image>
226                                                                         <name>openecomp/sdc-cassandra</name>
227                                                                         <alias>sdc-cassandra</alias>
228                                                                         <build>
229                                                                                 <cleanup>try</cleanup>
230                                                                                 <dockerFileDir>${project.basedir}/sdc-cassandra</dockerFileDir>
231                                                                                 <tags>
232                                                                                         <tag>${docker.tag}</tag>
233                                                                                         <tag>${docker.latest.tag}</tag>
234                                                                                         <tag>1.1-STAGING-latest</tag>
235                                                                                 </tags>
236                                                                         </build>
237                                                                 </image>
238
239                                                                 <!-- Build sanity image -->
240                                                                 <!-- <image>
241                                                                         <name>openecomp/sdc-sanity</name>
242                                                                         <alias>sdc-sanity</alias>
243                                                                         <build>
244                                                                                 <cleanup>try</cleanup>
245                                                                                 <dockerFileDir>${project.basedir}/sdc-sanity</dockerFileDir>
246                                                                                 <tags>
247                                                                                         <tag>${docker.tag}</tag>
248                                                                                         <tag>${docker.latest.tag}</tag>
249                                                                                         <tag>1.1-STAGING-latest</tag>
250                                                                                 </tags>
251                                                                         </build>
252                                                                 </image> -->
253
254                                                         </images>
255                                                 </configuration>
256                                                 <executions>
257                                                         <execution>
258                                 <id>clean-images</id>
259                                 <phase>pre-clean</phase>
260                                 <goals>
261                                 <goal>remove</goal>
262                                 </goals>
263                                 <configuration>
264                                 <removeAll>true</removeAll>
265                                 <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana<!-- ,openecomp/sdc-sanity --></image>
266                                 </configuration>
267                                                         </execution>
268
269                                                         <execution>
270                                                                 <id>generate-images</id>
271                                                                 <phase>package</phase>
272                                                                 <goals>
273                                                                         <goal>build</goal>
274                                                                 </goals>
275                                                         </execution>
276
277                                                         <execution>
278                                 <id>push-images</id>
279                                 <phase>deploy</phase>
280                                 <goals>
281                                                                         <goal>build</goal>
282                                                                         <goal>push</goal>
283                                 </goals>
284                                 <configuration>
285                                 <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana<!-- ,openecomp/sdc-sanity --></image>
286                                 </configuration>
287                                                         </execution>
288                                                 </executions>
289                                         </plugin>
290                                 </plugins>
291                         </build>
292                 </profile>
293         </profiles>
294 </project>