Roll to initial Dublin snapshot
[ccsdk/distribution.git] / ubuntu / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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">
3     <modelVersion>4.0.0</modelVersion>
4
5     <parent>
6         <groupId>org.onap.ccsdk.distribution</groupId>
7         <artifactId>distribution-root</artifactId>
8         <version>0.4.0-SNAPSHOT</version>
9     </parent>
10
11     <artifactId>distribution-ubuntu</artifactId>
12     <version>0.4.0-SNAPSHOT</version>
13     <packaging>pom</packaging>
14
15     <name>ccsdk-distribution :: ubuntu</name>
16     <description>Creates base ubuntu Docker container</description>
17     <organization>
18         <name>openECOMP</name>
19     </organization>
20
21     <properties>
22         <image.name>onap/ccsdk-ubuntu-image</image.name>
23         <ccsdk.project.version>${project.version}</ccsdk.project.version>
24     </properties>
25
26     <build>
27         <plugins>
28
29             <plugin>
30                 <groupId>org.codehaus.groovy.maven</groupId>
31                 <artifactId>gmaven-plugin</artifactId>
32                 <executions>
33                     <execution>
34                         <phase>validate</phase>
35                         <goals>
36                             <goal>execute</goal>
37                         </goals>
38                         <configuration>
39                             <source>
40                                 println project.properties['ccsdk.project.version'];
41                                 def versionArray;
42                                 if ( project.properties['ccsdk.project.version'] != null ) {
43                                     versionArray = project.properties['ccsdk.project.version'].split('\\.');
44                                 }
45
46                                 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
47                                 {
48                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
49                                 } else {
50                                     project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
51                                 }
52
53                                 println 'New Tag for docker:' +
54                                 project.properties['project.docker.latesttag.version'];
55                             </source>
56                         </configuration>
57                     </execution>
58                 </executions>
59             </plugin>
60
61             <plugin>
62                 <artifactId>maven-resources-plugin</artifactId>
63                 <version>2.6</version>
64                 <executions>
65                     <execution>
66                         <id>copy-dockerfile</id>
67                         <goals>
68                             <goal>copy-resources</goal>
69                         </goals><!-- here the phase you need -->
70                         <phase>validate</phase>
71                         <configuration>
72                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
73                             <resources>
74                                 <resource>
75                                     <directory>src/main/docker</directory>
76                                     <includes>
77                                         <include>Dockerfile</include>
78                                     </includes>
79                                     <filtering>true</filtering>
80                                 </resource>
81                             </resources>
82                         </configuration>
83                     </execution>
84                 </executions>
85             </plugin>
86         </plugins>
87     </build>
88
89     <profiles>
90         <profile>
91             <id>docker</id>
92             <build>
93                 <plugins>
94                     <plugin>
95                         <groupId>io.fabric8</groupId>
96                         <artifactId>docker-maven-plugin</artifactId>
97                         <version>0.16.5</version>
98                         <inherited>false</inherited>
99                         <configuration>
100
101                             <images>
102                                 <image>
103                                     <name>${image.name}</name>
104                                     <build>
105                                         <cleanup>try</cleanup>
106                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
107                                         <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
108                                         <tags>
109                                             <tag>${project.version}</tag>
110                                             <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
111                                             <tag>${project.docker.latesttag.version}</tag>
112                                         </tags>
113                                     </build>
114                                 </image>
115                             </images>
116                         </configuration>
117                         <executions>
118                             <execution>
119                                 <id>generate-images</id>
120                                 <phase>generate-sources</phase>
121                                 <goals>
122                                     <goal>build</goal>
123                                 </goals>
124                             </execution>
125
126                             <execution>
127                                 <id>push-images</id>
128                                 <phase>deploy</phase>
129                                 <goals>
130                                     <goal>build</goal>
131                                     <goal>push</goal>
132                                 </goals>
133                             </execution>
134                         </executions>
135                     </plugin>
136
137                 </plugins>
138             </build>
139         </profile>
140     </profiles>
141 </project>

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use