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">
6 <groupId>org.onap.ccsdk.distribution</groupId>
7 <artifactId>distribution-root</artifactId>
8 <version>0.2.0-SNAPSHOT</version>
11 <modelVersion>4.0.0</modelVersion>
12 <packaging>pom</packaging>
13 <groupId>org.onap.ccsdk.distribution</groupId>
14 <artifactId>distribution-dgbuilder-docker</artifactId>
15 <version>0.2.0-SNAPSHOT</version>
17 <name>Distribution - dgbuilder-docker</name>
18 <description>Creates docker container for dgbuilder</description>
21 <image.name>onap/ccsdk-dgbuilder-image</image.name>
22 <ccsdk.project.version>${project.version}</ccsdk.project.version>
31 <groupId>org.codehaus.groovy.maven</groupId>
32 <artifactId>gmaven-plugin</artifactId>
35 <phase>validate</phase>
41 println project.properties['ccsdk.project.version'];
43 if ( project.properties['ccsdk.project.version'] != null ) {
44 versionArray = project.properties['ccsdk.project.version'].split('\\.');
47 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
49 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
51 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
54 println 'New Tag for docker:' +
55 project.properties['project.docker.latesttag.version'];
62 <artifactId>maven-resources-plugin</artifactId>
63 <version>2.6</version>
66 <id>copy-dockerfile</id>
68 <goal>copy-resources</goal>
69 </goals><!-- here the phase you need -->
70 <phase>validate</phase>
72 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
75 <directory>src/main/docker</directory>
77 <include>Dockerfile</include>
79 <filtering>true</filtering>
88 <artifactId>exec-maven-plugin</artifactId>
89 <groupId>org.codehaus.mojo</groupId>
90 <version>1.5.0</version>
93 <id>Make-stage-dir</id>
94 <phase>generate-sources</phase>
99 <executable>/bin/mkdir</executable>
101 <argument>-p</argument>
102 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
107 <id>Unzip dgbuilder</id>
108 <phase>generate-sources</phase>
113 <executable>/usr/bin/unzip</executable>
115 <argument>-d</argument>
116 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
117 <argument>../dgbuilder/target/*.zip</argument>
122 <id>Copy dgbuilder</id>
123 <phase>generate-sources</phase>
128 <executable>/bin/cp</executable>
130 <argument>-r</argument>
131 <argument>../dgbuilder</argument>
132 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
138 <id>dgbuilder createReleaseDir</id>
139 <phase>generate-sources</phase>
144 <executable>/bin/bash</executable>
146 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/dgbuilder/createReleaseDir.sh</argument>
147 <argument>1702</argument>
148 <argument>dguser</argument>
149 <argument>change_email_id@dgbuilder.com</argument>
155 <id>change shell permissions</id>
156 <phase>process-sources</phase>
161 <executable>/usr/bin/find</executable>
163 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
164 <argument>-name</argument>
165 <argument>*.sh</argument>
166 <argument>-exec</argument>
167 <argument>chmod</argument>
168 <argument>+x</argument>
169 <argument>{}</argument>
170 <argument>;</argument>
184 <groupId>io.fabric8</groupId>
185 <artifactId>docker-maven-plugin</artifactId>
186 <version>0.16.5</version>
187 <inherited>false</inherited>
192 <name>${image.name}</name>
194 <cleanup>try</cleanup>
195 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
196 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
198 <tag>${project.version}</tag>
199 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
200 <tag>${project.docker.latesttag.version}</tag>
208 <id>generate-images</id>
209 <phase>package</phase>
217 <phase>deploy</phase>