CLI version update
[cli.git] / deployment / docker / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     Copyright 2017 Huawei Technologies Co., Ltd.
4
5     Licensed under the Apache License, Version 2.0 (the "License");
6     you may not use this file except in compliance with the License.
7     You may obtain a copy of the License at
8
9         http://www.apache.org/licenses/LICENSE-2.0
10
11     Unless required by applicable law or agreed to in writing, software
12     distributed under the License is distributed on an "AS IS" BASIS,
13     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14     See the License for the specific language governing permissions and
15     limitations under the License.
16  -->
17 <project xmlns="http://maven.apache.org/POM/4.0.0"
18          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
20          http://maven.apache.org/xsd/maven-4.0.0.xsd">
21     <modelVersion>4.0.0</modelVersion>
22
23     <parent>
24         <groupId>org.onap.cli</groupId>
25         <artifactId>cli-deployment</artifactId>
26         <version>2.0.4</version>
27     </parent>
28
29     <artifactId>cli-docker</artifactId>
30     <name>cli/deployment/docker</name>
31     <packaging>pom</packaging>
32
33   <properties>
34         <docker.image.name>onap/cli</docker.image.name>
35         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
36         <docker.push.registry></docker.push.registry>
37         <skip.docker.build>true</skip.docker.build>
38         <skip.docker.tag>true</skip.docker.tag>
39         <skip.docker.push>true</skip.docker.push>
40   </properties>
41
42     <build>
43         <plugins>
44             <plugin>
45                 <groupId>com.spotify</groupId>
46                 <artifactId>docker-maven-plugin</artifactId>
47                 <version>0.4.11</version>
48                 <configuration>
49                     <verbose>true</verbose>
50                     <imageName>${docker.image.name}</imageName>
51                     <serverId>docker-hub</serverId>
52                     <dockerDirectory>${basedir}/src/main/docker</dockerDirectory>
53                     <resources>
54                         <resource>
55                             <targetPath>/STAGE</targetPath>
56                             <directory>${basedir}/../zip/target/deployunzip</directory>
57                             <includes>
58                                 <include>**/*</include>
59                             </includes>
60                         </resource>
61                         <resource>
62                             <targetPath>/STAGE/http</targetPath>
63                             <directory>${basedir}/../http/</directory>
64                             <includes>
65                                 <include>**/*</include>
66                             </includes>
67                         </resource>
68                         <resource>
69                             <targetPath>/STAGE/installer</targetPath>
70                             <directory>${basedir}/../zip/target/deployoutput</directory>
71                             <includes>
72                                 <include>**/*</include>
73                             </includes>
74                         </resource>
75                     </resources>
76                 </configuration>
77                 <executions>
78                     <execution>
79                         <id>build-image</id>
80                         <phase>package</phase>
81                         <goals>
82                             <goal>build</goal>
83                         </goals>
84                         <configuration>
85                             <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
86                         </configuration>
87                     </execution>
88                     <execution>
89                         <id>tag-image-timestamped-version</id>
90                         <phase>deploy</phase>
91                         <goals>
92                             <goal>tag</goal>
93                         </goals>
94                         <configuration>
95                             <image>${docker.image.name}</image>
96                             <newName>${docker.push.registry}/${docker.image.name}:${project.version}-${maven.build.timestamp}</newName>
97                             <pushImage>${skip.docker.push}</pushImage>
98                             <skipDockerTag>${skip.docker.tag}</skipDockerTag>
99                         </configuration>
100                     </execution>
101                     <execution>
102                         <id>tag-image-project-version</id>
103                         <phase>deploy</phase>
104                         <goals>
105                             <goal>tag</goal>
106                         </goals>
107                         <configuration>
108                             <image>${docker.image.name}</image>
109                             <newName>${docker.push.registry}/${docker.image.name}:${project.version}</newName>
110                             <pushImage>${skip.docker.push}</pushImage>
111                             <skipDockerTag>${skip.docker.tag}</skipDockerTag>
112                         </configuration>
113                     </execution>
114                     <execution>
115                         <id>tag-image-latest-version</id>
116                         <phase>deploy</phase>
117                         <goals>
118                             <goal>tag</goal>
119                         </goals>
120                         <configuration>
121                             <image>${docker.image.name}</image>
122                             <newName>${docker.push.registry}/${docker.image.name}:latest</newName>
123                             <pushImage>${skip.docker.push}</pushImage>
124                             <skipDockerTag>${skip.docker.tag}</skipDockerTag>
125                         </configuration>
126                     </execution>
127                 </executions>
128             </plugin>
129         </plugins>
130     </build>
131 </project>