blob: 8f17a9875049c96385f7338972c9422d14389bb2 [file] [log] [blame]
Dan Timoney73be2112017-08-09 13:37:32 -04001<?xml version="1.0" encoding="UTF-8"?>
Dan Timoney912f98b2018-02-27 14:10:22 -05002<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>
Dan Timoney73be2112017-08-09 13:37:32 -04004
Dan Timoney74e4e8d2017-08-22 11:51:54 -04005 <parent>
6 <groupId>org.onap.ccsdk.distribution</groupId>
7 <artifactId>distribution-root</artifactId>
Timoney, Dan (dt5972)e7cfae52019-01-03 15:14:58 -05008 <version>0.4.1-SNAPSHOT</version>
Dan Timoney74e4e8d2017-08-22 11:51:54 -04009 </parent>
Dan Timoney73be2112017-08-09 13:37:32 -040010
Dan Timoney74e4e8d2017-08-22 11:51:54 -040011 <artifactId>distribution-ubuntu</artifactId>
Timoney, Dan (dt5972)e7cfae52019-01-03 15:14:58 -050012 <version>0.4.1-SNAPSHOT</version>
Dan Timoney912f98b2018-02-27 14:10:22 -050013 <packaging>pom</packaging>
Dan Timoney73be2112017-08-09 13:37:32 -040014
Dan Timoney912f98b2018-02-27 14:10:22 -050015 <name>ccsdk-distribution :: ubuntu</name>
Dan Timoney74e4e8d2017-08-22 11:51:54 -040016 <description>Creates base ubuntu Docker container</description>
Dan Timoney912f98b2018-02-27 14:10:22 -050017 <organization>
18 <name>openECOMP</name>
19 </organization>
Dan Timoney73be2112017-08-09 13:37:32 -040020
Dan Timoney74e4e8d2017-08-22 11:51:54 -040021 <properties>
22 <image.name>onap/ccsdk-ubuntu-image</image.name>
23 <ccsdk.project.version>${project.version}</ccsdk.project.version>
24 </properties>
Dan Timoney73be2112017-08-09 13:37:32 -040025
Dan Timoney74e4e8d2017-08-22 11:51:54 -040026 <build>
27 <plugins>
Dan Timoney73be2112017-08-09 13:37:32 -040028
Dan Timoney74e4e8d2017-08-22 11:51:54 -040029 <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 }
Dan Timoney73be2112017-08-09 13:37:32 -040045
Dan Timoney74e4e8d2017-08-22 11:51:54 -040046 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 }
Dan Timoney73be2112017-08-09 13:37:32 -040052
Dan Timoney74e4e8d2017-08-22 11:51:54 -040053 println 'New Tag for docker:' +
54 project.properties['project.docker.latesttag.version'];
55 </source>
56 </configuration>
57 </execution>
58 </executions>
59 </plugin>
Dan Timoney73be2112017-08-09 13:37:32 -040060
Dan Timoney74e4e8d2017-08-22 11:51:54 -040061 <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>
Dan Timoney74e4e8d2017-08-22 11:51:54 -040087 </build>
Dan Timoney73be2112017-08-09 13:37:32 -040088
Dan Timoney74e4e8d2017-08-22 11:51:54 -040089 <profiles>
90 <profile>
91 <id>docker</id>
92 <build>
93 <plugins>
94 <plugin>
95 <groupId>io.fabric8</groupId>
96 <artifactId>docker-maven-plugin</artifactId>
Timoney, Dan (dt5972)b1ac7252018-12-14 13:00:43 -050097 <version>0.26.0</version>
Dan Timoney74e4e8d2017-08-22 11:51:54 -040098 <inherited>false</inherited>
99 <configuration>
Dan Timoney73be2112017-08-09 13:37:32 -0400100
Dan Timoney74e4e8d2017-08-22 11:51:54 -0400101 <images>
102 <image>
103 <name>${image.name}</name>
104 <build>
105 <cleanup>try</cleanup>
106 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
Timoney, Dan (dt5972)b1ac7252018-12-14 13:00:43 -0500107 <dockerFile>Dockerfile</dockerFile>
Dan Timoney74e4e8d2017-08-22 11:51:54 -0400108 <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>
Dan Timoney73be2112017-08-09 13:37:32 -0400141</project>