Update docker tags configuration
[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         <properties>
15                 <docker.tag>${project.version}-SNAPSHOT-${maven.build.timestamp}</docker.tag>
16                 <docker.latest.tag>${project.version}-SNAPSHOT-latest</docker.latest.tag>
17         </properties>
18
19         <build>
20                 <plugins>
21                         <plugin>
22                                 <groupId>com.google.code.maven-replacer-plugin</groupId>
23                                 <artifactId>replacer</artifactId>
24                                 <version>1.5.3</version>
25                                 <executions>
26                                         <execution>
27                                                 <phase>prepare-package</phase>
28                                                 <goals>
29                                                         <goal>replace</goal>
30                                                 </goals>
31                                         </execution>
32                                 </executions>
33
34                                 <configuration>
35                                         <basedir>${project.basedir}</basedir>
36                                         <includes>
37                                                 <include>sdc-backend/Dockerfile</include>
38                                                 <include>sdc-frontend/Dockerfile</include>
39                                                 <include>scripts/docker_run.sh</include>
40                                         </includes>
41                                         <replacements>
42                                                 <replacement>
43                                                         <token>__SDC-RELEASE__</token>
44                                                         <value>${project.version}</value>
45                                                 </replacement>
46                                         </replacements>
47                                 </configuration>
48                         </plugin>
49                 </plugins>
50         </build>
51
52         <profiles>
53                 <profile>
54                         <id>docker-staging</id>
55                         <properties>
56                                 <docker.tag>${project.version}-STAGING-${maven.build.timestamp}</docker.tag>
57                                 <docker.latest.tag>${project.version}-STAGING-latest</docker.latest.tag>
58                         </properties>
59                 </profile>
60                 <profile>
61                         <id>docker</id>
62                         <build>
63                                 <plugins>
64                                         <plugin>
65                                                 <artifactId>maven-resources-plugin</artifactId>
66                                                 <version>3.0.2</version>
67                                                 <executions>
68                                                         <execution>
69                                                                 <id>copy-resources-be</id>
70                                                                 <!-- here the phase you need -->
71                                                                 <phase>validate</phase>
72                                                                 <goals>
73                                                                         <goal>copy-resources</goal>
74                                                                 </goals>
75                                                                 <configuration>
76                                                                         <outputDirectory>${basedir}/sdc-backend</outputDirectory>
77                                                                         <resources>
78                                                                                 <resource>
79                                                                                         <directory>${project.parent.basedir}/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/target</directory>
80                                                                                         <includes>
81                                                                                                 <include>onboarding-be-*.war</include>
82                                                                                         </includes>
83                                                                                 </resource>
84                                                                         </resources>
85                                                                 </configuration>
86                                                         </execution>
87                                                         <execution>
88                                                                 <id>copy-resources-fe</id>
89                                                                 <!-- here the phase you need -->
90                                                                 <phase>validate</phase>
91                                                                 <goals>
92                                                                         <goal>copy-resources</goal>
93                                                                 </goals>
94                                                                 <configuration>
95                                                                         <outputDirectory>${basedir}/sdc-frontend</outputDirectory>
96                                                                         <resources>
97                                                                                 <resource>
98                                                                                         <directory>${project.parent.basedir}/openecomp-ui/target</directory>
99                                                                                         <includes>
100                                                                                                 <include>onboarding-fe-${project.version}.war</include>
101                                                                                         </includes>
102                                                                                 </resource>
103                                                                         </resources>
104                                                                 </configuration>
105                                                         </execution>
106                                                         <execution>
107                                                                 <id>copy-resources-sanity</id>
108                                                                 <!-- here the phase you need -->
109                                                                 <phase>validate</phase>
110                                                                 <goals>
111                                                                         <goal>copy-resources</goal>
112                                                                 </goals>
113                                                                 <configuration>
114                                                                         <outputDirectory>${basedir}/sdc-frontend</outputDirectory>
115                                                                         <resources>
116                                                                                 <resource>
117                                                                                         <directory>${project.parent.basedir}/openecomp-ui/target</directory>
118                                                                                         <includes>
119                                                                                                 <include>onboarding-fe-${project.version}.war</include>
120                                                                                         </includes>
121                                                                                 </resource>
122                                                                         </resources>
123                                                                 </configuration>
124                                                         </execution>
125                                                 </executions>
126                                         </plugin>
127
128
129
130                                         <plugin>
131                                                 <groupId>io.fabric8</groupId>
132                                                 <artifactId>docker-maven-plugin</artifactId>
133                                                 <version>0.19.1</version>
134
135                                                 <configuration>
136                                                         <verbose>true</verbose>
137                                                         <apiVersion>1.23</apiVersion>
138
139                                                         <images>
140
141                                                                 <!-- Build backend image -->
142                                                                 <image>
143                                                                         <name>openecomp/sdc-backend</name>
144                                                                         <alias>sdc-backend</alias>
145                                                                         <build>
146                                                                                 <cleanup>try</cleanup>
147                                                                                 <dockerFileDir>${project.basedir}/sdc-backend</dockerFileDir>
148                                                                                 <tags>
149                                                                                         <tag>${docker.tag}</tag>
150                                                                                         <tag>${docker.latest.tag}</tag>
151                                                                                 </tags>
152                                                                         </build>
153                                                                 </image>
154
155                                                                 <!-- Build frontend image -->
156                                                                 <image>
157                                                                         <name>openecomp/sdc-frontend</name>
158                                                                         <alias>sdc-frontend</alias>
159                                                                         <build>
160                                                                                 <cleanup>try</cleanup>
161                                                                                 <dockerFileDir>${project.basedir}/sdc-frontend</dockerFileDir>
162                                                                                 <tags>
163                                                                                         <tag>${docker.tag}</tag>
164                                                                                         <tag>${docker.latest.tag}</tag>
165                                                                                 </tags>
166                                                                         </build>
167                                                                 </image>
168
169                                                                 <!-- Build elastic search image -->
170                                                                 <image>
171                                                                         <name>openecomp/sdc-elasticsearch</name>
172                                                                         <alias>sdc-elasticsearch</alias>
173                                                                         <build>
174                                                                                 <cleanup>try</cleanup>
175                                                                                 <dockerFileDir>${project.basedir}/sdc-elasticsearch</dockerFileDir>
176                                                                                 <tags>
177                                                                                         <tag>${docker.tag}</tag>
178                                                                                         <tag>${docker.latest.tag}</tag>
179                                                                                 </tags>
180                                                                         </build>
181                                                                 </image>
182
183                                                                 <!-- Build kibana image -->
184                                                                 <image>
185                                                                         <name>openecomp/sdc-kibana</name>
186                                                                         <alias>sdc-kibana</alias>
187                                                                         <build>
188                                                                                 <cleanup>try</cleanup>
189                                                                                 <dockerFileDir>${project.basedir}/sdc-kibana</dockerFileDir>
190                                                                                 <tags>
191                                                                                         <tag>${docker.tag}</tag>
192                                                                                         <tag>${docker.latest.tag}</tag>
193                                                                                 </tags>
194                                                                         </build>
195                                                                 </image>
196
197                                                                 <!-- Build cassandra image -->
198                                                                 <image>
199                                                                         <name>openecomp/sdc-cassandra</name>
200                                                                         <alias>sdc-cassandra</alias>
201                                                                         <build>
202                                                                                 <cleanup>try</cleanup>
203                                                                                 <dockerFileDir>${project.basedir}/sdc-cassandra</dockerFileDir>
204                                                                                 <tags>
205                                                                                         <tag>${docker.tag}</tag>
206                                                                                         <tag>${docker.latest.tag}</tag>
207                                                                                 </tags>
208                                                                         </build>
209                                                                 </image>
210                                                                 
211                                                                 <!-- Build sanity image -->
212                                                                 <image>
213                                                                         <name>openecomp/sdc-sanity</name>
214                                                                         <alias>sdc-sanity</alias>
215                                                                         <build>
216                                                                                 <cleanup>try</cleanup>
217                                                                                 <dockerFileDir>${project.basedir}/sdc-sanity</dockerFileDir>
218                                                                                 <tags>
219                                                                                         <tag>${docker.tag}</tag>
220                                                                                         <tag>${docker.latest.tag}</tag>
221                                                                                 </tags>
222                                                                         </build>
223                                                                 </image>
224
225                                                         </images>
226                                                 </configuration>
227                                                 <executions>
228                                                         <execution>
229                                                                 <id>clean-images</id>
230                                                                 <phase>pre-clean</phase>
231                                                                 <goals>
232                                                                         <goal>remove</goal>
233                                                                 </goals>
234                                                                 <configuration>
235                                                                         <removeAll>true</removeAll>
236                                                                         <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana,openecomp/sdc-sanity</image>
237                                                                 </configuration>
238                                                         </execution>
239
240                                                         <execution>
241                                                                 <id>generate-images</id>
242                                                                 <phase>package</phase>
243                                                                 <goals>
244                                                                         <goal>build</goal>
245                                                                 </goals>
246                                                         </execution>
247
248                                                         <execution>
249                                                                 <id>push-images</id>
250                                                                 <phase>deploy</phase>
251                                                                 <goals>
252                                                                         <goal>push</goal>
253                                                                 </goals>
254                                                                 <configuration>
255                                                                         <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana,openecomp/sdc-sanity</image>
256                                                                 </configuration>
257                                                         </execution>
258                                                 </executions>
259
260                                         </plugin>
261
262                                 </plugins>
263                         </build>
264                 </profile>
265         </profiles>
266 </project>