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