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