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