Migrate ccsdk/apps to ccsdk/cds
[ccsdk/cds.git] / ms / blueprintsprocessor / distribution / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ~  Copyright © 2019 IBM, Bell Canada.
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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18     <modelVersion>4.0.0</modelVersion>
19     <parent>
20         <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
21         <artifactId>parent</artifactId>
22         <version>0.4.2-SNAPSHOT</version>
23         <relativePath>../parent</relativePath>
24     </parent>
25     <artifactId>distribution</artifactId>
26     <packaging>pom</packaging>
27     <name>Blueprints Processor Distribution</name>
28     <properties>
29         <assembly.id>maven</assembly.id>
30         <name.space>org.onap.ccsdk.cds</name.space>
31         <serviceArtifactName>blueprintsprocessor</serviceArtifactName>
32         <image.name>onap/ccsdk-blueprintsprocessor</image.name>
33         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
34         <docker.push.phase>deploy</docker.push.phase>
35         <docker.verbose>true</docker.verbose>
36         <ccsdk.project.version>${project.version}</ccsdk.project.version>
37         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
38     </properties>
39
40     <dependencies>
41         <dependency>
42             <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
43             <artifactId>application</artifactId>
44         </dependency>
45     </dependencies>
46     <build>
47         <plugins>
48             <plugin>
49                 <artifactId>maven-resources-plugin</artifactId>
50                 <version>2.6</version>
51                 <executions>
52                     <execution>
53                         <id>copy-dockerfile</id>
54                         <goals>
55                             <goal>copy-resources</goal>
56                         </goals><!-- here the phase you need -->
57                         <phase>validate</phase>
58                         <configuration>
59                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
60                             <resources>
61                                 <resource>
62                                     <directory>src/main/docker</directory>
63                                     <includes>
64                                         <include>*</include>
65                                     </includes>
66                                     <filtering>true</filtering>
67                                 </resource>
68                             </resources>
69                         </configuration>
70                     </execution>
71                 </executions>
72             </plugin>
73             <plugin>
74                 <groupId>org.apache.maven.plugins</groupId>
75                 <artifactId>maven-antrun-plugin</artifactId>
76                 <executions>
77                     <execution>
78                         <id>ant-test</id>
79                         <phase>package</phase>
80                         <configuration>
81                             <tasks>
82                                 <fixcrlf srcdir="${basedir}" eol="unix" includes="**/*.sh, **/*.source"/>
83                             </tasks>
84                         </configuration>
85                         <goals>
86                             <goal>run</goal>
87                         </goals>
88                     </execution>
89                 </executions>
90             </plugin>
91             <plugin>
92                 <!--build the final artifact for docker deployment -->
93                 <artifactId>maven-assembly-plugin</artifactId>
94                 <version>3.1.0</version>
95                 <configuration>
96                     <!-- <skipAssembly>${skip.assembly}</skipAssembly> -->
97                     <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
98                     <descriptors>
99                         <descriptor>src/main/docker/distribution.xml</descriptor>
100                     </descriptors>
101                     <tarLongFileMode>posix</tarLongFileMode>
102                 </configuration>
103                 <executions>
104                     <execution>
105                         <id>${assembly.id}</id>
106                         <phase>package</phase>
107                         <goals>
108                             <goal>single</goal>
109                         </goals>
110                     </execution>
111                 </executions>
112             </plugin>
113             <plugin>
114                 <groupId>org.codehaus.groovy.maven</groupId>
115                 <artifactId>gmaven-plugin</artifactId>
116                 <version>1.0</version>
117                 <executions>
118                     <execution>
119                         <phase>validate</phase>
120                         <goals>
121                             <goal>execute</goal>
122                         </goals>
123                         <configuration>
124                             <source>${basedir}/../../../TagVersion.groovy</source>
125                         </configuration>
126                     </execution>
127                 </executions>
128             </plugin>
129
130         </plugins>
131     </build>
132
133     <profiles>
134         <profile>
135             <id>docker</id>
136             <build>
137                 <plugins>
138                     <plugin>
139                         <groupId>io.fabric8</groupId>
140                         <artifactId>docker-maven-plugin</artifactId>
141                         <version>0.26.1</version>
142                         <inherited>false</inherited>
143                         <configuration>
144                             <images>
145                                 <image>
146                                     <name>${image.name}</name>
147                                     <build>
148                                         <cleanup>try</cleanup>
149                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
150                                         <tags>
151                                             <tag>${project.docker.latestminortag.version}</tag>
152                                             <tag>${project.docker.latestfulltag.version}</tag>
153                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
154                                         </tags>
155                                     </build>
156                                 </image>
157                             </images>
158                             <verbose>true</verbose>
159                         </configuration>
160                         <executions>
161                             <execution>
162                                 <id>generate-images</id>
163                                 <phase>package</phase>
164                                 <goals>
165                                     <goal>build</goal>
166                                 </goals>
167                             </execution>
168                             <execution>
169                                 <id>push-images</id>
170                                 <phase>${docker.push.phase}</phase>
171                                 <goals>
172                                     <goal>build</goal>
173                                     <goal>push</goal>
174                                 </goals>
175                             </execution>
176                         </executions>
177                     </plugin>
178                 </plugins>
179             </build>
180         </profile>
181
182     </profiles>
183 </project>