blob: 37c0b8448e5cb986fb9e0632c2159078cb0b2c36 [file] [log] [blame]
Muthuramalingam, Brinda Santh(bs2796)d3efe722018-08-23 15:54:30 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 ~ Copyright © 2017-2018 AT&T Intellectual Property.
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
18<project
19 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
20 xmlns="http://maven.apache.org/POM/4.0.0"
21 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
22 <modelVersion>4.0.0</modelVersion>
23 <parent>
24 <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId>
25 <artifactId>parent</artifactId>
26 <version>0.3.0-SNAPSHOT</version>
27 <relativePath>../parent</relativePath>
28 </parent>
29 <artifactId>distribution</artifactId>
30 <packaging>pom</packaging>
31 <name>Controller Blueprints Distribution</name>
32 <properties>
33 <assembly.id>maven</assembly.id>
34 <name.space>org.onap.ccsdk.apps</name.space> <!-- <name.space>${namespace}</name.space> -->
35 <serviceArtifactName>controllerblueprints</serviceArtifactName>
36 <image.name>onap/ccsdk-controllerblueprints</image.name>
37 </properties>
38
39 <dependencies>
40 <dependency>
41 <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId>
42 <artifactId>application</artifactId>
43 </dependency>
44 </dependencies>
45 <build>
46 <plugins>
47 <plugin>
48 <artifactId>maven-resources-plugin</artifactId>
49 <version>2.6</version>
50 <executions>
51 <execution>
52 <id>copy-dockerfile</id>
53 <goals>
54 <goal>copy-resources</goal>
55 </goals><!-- here the phase you need -->
56 <phase>validate</phase>
57 <configuration>
58 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
59 <resources>
60 <resource>
61 <directory>src/main/docker</directory>
62 <includes>
63 <include>*</include>
64 </includes>
65 <filtering>true</filtering>
66 </resource>
67 </resources>
68 </configuration>
69 </execution>
70 </executions>
71 </plugin>
72 <plugin>
73 <groupId>org.apache.maven.plugins</groupId>
74 <artifactId>maven-antrun-plugin</artifactId>
75 <executions>
76 <execution>
77 <id>ant-test</id>
78 <phase>package</phase>
79 <configuration>
80 <tasks>
81 <fixcrlf srcdir="${basedir}" eol="unix"
82 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.0.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>
125 println project.properties['ccsdk.project.version'];
126 def versionArray;
127 if (project.properties['ccsdk.project.version'] != null ) {
128 versionArray = project.properties['ccsdk.project.version'].split('\\.');
129 }
130
131 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
132 {
133 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
134 } else {
135 project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
136 }
137
138 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
139 </source>
140 </configuration>
141 </execution>
142 </executions>
143 </plugin>
144 <plugin>
145 <groupId>io.fabric8</groupId>
146 <artifactId>docker-maven-plugin</artifactId>
147 <version>0.26.1</version>
148 <inherited>false</inherited>
149 <configuration>
150 <images>
151 <image>
152 <name>${image.name}</name>
153 <build>
154 <cleanup>try</cleanup>
155 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
156 <tags>
157 <tag>${project.version}</tag>
158 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
159 <tag>${project.docker.latesttag.version}</tag>
160 </tags>
161 </build>
162 </image>
163 </images>
164 <verbose>true</verbose>
165 </configuration>
166 <executions>
167 <!--<execution>-->
168 <!--<id>build-images</id>-->
169 <!--<phase>package</phase>-->
170 <!--<goals>-->
171 <!--<goal>build</goal>-->
172 <!--</goals>-->
173 <!--</execution>-->
174 <execution>
175 <id>push-images</id>
176 <phase>deploy</phase>
177 <goals>
178 <goal>build</goal>
179 <goal>push</goal>
180 </goals>
181 </execution>
182 </executions>
183 </plugin>
184 </plugins>
185 </build>
186</project>
187