Fix docker tags 33/78333/1
authorTimoney, Dan (dt5972) <dtimoney@att.com>
Tue, 12 Feb 2019 19:35:10 +0000 (14:35 -0500)
committerTimoney, Dan (dt5972) <dtimoney@att.com>
Tue, 12 Feb 2019 19:35:10 +0000 (14:35 -0500)
Updated docker tags to conform to ONAP standards

Change-Id: If461ee7ea99a1966e66a03a3a970d0acef835320
Issue-ID: CCSDK-1059
Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
15 files changed:
alpine/pom.xml
ansible-server/pom.xml
dgbuilder-docker/pom.xml
dgbuilder-docker/src/main/docker/Dockerfile
odlsli/odlsli-alpine/pom.xml
odlsli/odlsli-alpine/src/main/docker/Dockerfile
odlsli/odlsli-ubuntu/pom.xml
odlsli/odlsli-ubuntu/src/main/docker/Dockerfile
opendaylight/fluorine/fluorine-alpine/pom.xml
opendaylight/fluorine/fluorine-alpine/src/main/docker/Dockerfile
opendaylight/fluorine/fluorine-ubuntu/pom.xml
opendaylight/fluorine/fluorine-ubuntu/src/main/docker/Dockerfile
saltstack-server/pom.xml
src/main/scripts/TagVersion.groovy [new file with mode: 0644]
ubuntu/pom.xml

index 8e3a164..3aebe95 100644 (file)
@@ -21,6 +21,7 @@
     <properties>
         <image.name>onap/ccsdk-alpine-image</image.name>
         <ccsdk.project.version>${project.version}</ccsdk.project.version>
+        <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
     </properties>
 
     <build>
                         <goals>
                             <goal>execute</goal>
                         </goals>
-                        <configuration>
-                            <source>
-                                println project.properties['ccsdk.project.version'];
-                                def versionArray;
-                                if ( project.properties['ccsdk.project.version'] != null ) {
-                                    versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                }
-
-                                if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                } else {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                }
-
-                                println 'New Tag for docker:' +
-                                project.properties['project.docker.latesttag.version'];
-                            </source>
+                        <configuration>     
+                            <source>${basedir}/../src/main/scripts/TagVersion.groovy</source>
                         </configuration>
                     </execution>
                 </executions>
                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
                                         <dockerFile>Dockerfile</dockerFile>
                                         <tags>
-                                            <tag>${project.version}</tag>
-                                            <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                            <tag>${project.docker.latesttag.version}</tag>
+                                            <tag>${project.docker.latestminortag.version}</tag>
+                                            <tag>${project.docker.latestfulltag.version}</tag>              
+                                            <tag>${project.docker.latesttagtimestamp.version}</tag>
                                         </tags>
                                     </build>
                                 </image>
index a809202..662864c 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<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/maven-v4_0_0.xsd">
+<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/maven-v4_0_0.xsd">
 
-   <parent>
-        <groupId>org.onap.ccsdk.parent</groupId>
-        <artifactId>odlparent-lite</artifactId>
-        <version>1.2.1-SNAPSHOT</version>
-    </parent>
+       <parent>
+               <groupId>org.onap.ccsdk.parent</groupId>
+               <artifactId>odlparent-lite</artifactId>
+               <version>1.2.1-SNAPSHOT</version>
+       </parent>
 
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>pom</packaging>
-    <groupId>org.onap.ccsdk.distribution</groupId>
-    <artifactId>ansible-server</artifactId>
-    <version>0.4.1-SNAPSHOT</version>
+       <modelVersion>4.0.0</modelVersion>
+       <packaging>pom</packaging>
+       <groupId>org.onap.ccsdk.distribution</groupId>
+       <artifactId>ansible-server</artifactId>
+       <version>0.4.1-SNAPSHOT</version>
 
-    <name>ccsdk :: distribution :: ${project.artifactId}</name>
-    <description>Creates ansible-server Docker container</description>
+       <name>ccsdk :: distribution :: ${project.artifactId}</name>
+       <description>Creates ansible-server Docker container</description>
 
-    <properties>
-        <image.name>onap/ccsdk-ansible-server-image</image.name>
-        <ccsdk.project.version>${project.version}</ccsdk.project.version>
-             <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
-        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
-       <docker.verbose>true</docker.verbose>
-    </properties>
+       <properties>
+               <image.name>onap/ccsdk-ansible-server-image</image.name>
+               <ccsdk.project.version>${project.version}</ccsdk.project.version>
+               <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
+               <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
+               <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
+               <docker.verbose>true</docker.verbose>
+       </properties>
 
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.codehaus.groovy.maven</groupId>
-                <artifactId>gmaven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <source>
-                                println project.properties['ccsdk.project.version'];
-                                def versionArray;
-                                if ( project.properties['ccsdk.project.version'] != null ) {
-                                versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                }
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.codehaus.groovy.maven</groupId>
+                               <artifactId>gmaven-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>execute</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <source>${basedir}/../src/main/scripts/TagVersion.groovy</source>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
 
-                                if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                {
-                                project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                } else {
-                                project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                }
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-dockerfile</id>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals><!-- here the phase you need -->
+                                               <phase>validate</phase>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+                                                       <resources>
+                                                               <resource>
+                                                                       <directory>src/main</directory>
+                                                                       <includes>
+                                                                               <include>**/*</include>
+                                                                       </includes>
+                                                                       <filtering>false</filtering>
+                                                               </resource>
+                                                       </resources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
 
-                                println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
-                            </source>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+                       <plugin>
+                               <artifactId>exec-maven-plugin</artifactId>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <version>1.5.0</version>
+                               <executions>
+                                       <execution>
+                                               <id>change python permissions</id>
+                                               <phase>process-sources</phase>
+                                               <goals>
+                                                       <goal>exec</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <executable>/usr/bin/find</executable>
+                                                       <arguments>
+                                                               <argument>${basedir}/target/docker-stage/ansible-server</argument>
+                                                               <argument>-name</argument>
+                                                               <argument>*.py</argument>
+                                                               <argument>-exec</argument>
+                                                               <argument>chmod</argument>
+                                                               <argument>+x</argument>
+                                                               <argument>{}</argument>
+                                                               <argument>;</argument>
+                                                       </arguments>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
 
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>2.6</version>
-                <executions>
-                    <execution>
-                        <id>copy-dockerfile</id>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals><!-- here the phase you need -->
-                        <phase>validate</phase>
-                        <configuration>
-                            <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>src/main</directory>
-                                    <includes>
-                                        <include>**/*</include>
-                                    </includes>
-                                    <filtering>false</filtering>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+       <profiles>
+               <profile>
+                       <id>docker</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>io.fabric8</groupId>
+                                               <artifactId>docker-maven-plugin</artifactId>
+                                               <version>0.16.5</version>
+                                               <inherited>false</inherited>
+                                               <configuration>
+                                                       <images>
+                                                               <image>
+                                                                       <name>${image.name}</name>
+                                                                       <build>
+                                                                               <cleanup>try</cleanup>
+                                                                               <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
+                                                                               <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
+                                                                               <tags>
+                                                                                       <tag>${project.docker.latestminortag.version}</tag>
+                                                                                       <tag>${project.docker.latestfulltag.version}</tag>
+                                                                                       <tag>${project.docker.latesttagtimestamp.version}</tag>
+                                                                               </tags>
+                                                                       </build>
+                                                               </image>
+                                                       </images>
+                                               </configuration>
+                                               <executions>
+                                                       <execution>
+                                                               <id>generate-images</id>
+                                                               <phase>package</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                               </goals>
+                                                       </execution>
 
-            <plugin>
-                <artifactId>exec-maven-plugin</artifactId>
-                <groupId>org.codehaus.mojo</groupId>
-                <version>1.5.0</version>
-                <executions>
-                    <execution>
-                        <id>change python permissions</id>
-                        <phase>process-sources</phase>
-                        <goals>
-                            <goal>exec</goal>
-                        </goals>
-                        <configuration>
-                            <executable>/usr/bin/find</executable>
-                            <arguments>
-                                <argument>${basedir}/target/docker-stage/ansible-server</argument>
-                                <argument>-name</argument>
-                                <argument>*.py</argument>
-                                <argument>-exec</argument>
-                                <argument>chmod</argument>
-                                <argument>+x</argument>
-                                <argument>{}</argument>
-                                <argument>;</argument>
-                            </arguments>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>docker</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>io.fabric8</groupId>
-                        <artifactId>docker-maven-plugin</artifactId>
-                        <version>0.16.5</version>
-                        <inherited>false</inherited>
-                        <configuration>
-                            <images>
-                                <image>
-                                    <name>${image.name}</name>
-                                    <build>
-                                        <cleanup>try</cleanup>
-                                        <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
-                                        <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
-                                        <tags>
-                                            <tag>${project.version}</tag>
-                                            <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                            <tag>${project.docker.latesttag.version}</tag>
-                                        </tags>
-                                    </build>
-                                </image>
-                            </images>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <id>generate-images</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                </goals>
-                            </execution>
-
-                            <execution>
-                                <id>push-images</id>
-                                <phase>deploy</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                    <goal>push</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-    <organization>
-        <name>ONAP</name>
-    </organization>
+                                                       <execution>
+                                                               <id>push-images</id>
+                                                               <phase>deploy</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                                       <goal>push</goal>
+                                                               </goals>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                               </plugins>
+                       </build>
+               </profile>
+       </profiles>
+       <organization>
+               <name>ONAP</name>
+       </organization>
 </project>
index 998bc3b..2c160fc 100644 (file)
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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">
+<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">
        <modelVersion>4.0.0</modelVersion>
 
        <parent>
        <properties>
                <image.name>onap/ccsdk-dgbuilder-image</image.name>
                <ccsdk.project.version>${project.version}</ccsdk.project.version>
+               <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
        </properties>
 
        <build>
                <plugins>
 
 
-            <plugin>
-                <groupId>org.codehaus.groovy.maven</groupId>
-                <artifactId>gmaven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <source>
-                                println project.properties['ccsdk.project.version'];
-                                def versionArray;
-                                if ( project.properties['ccsdk.project.version'] != null ) {
-                                    versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                }
-
-                                if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0]  + '.' + versionArray[1] + "-STAGING-latest";
-                                } else {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                }
-
-                                println 'New Tag for docker:' +
-                                project.properties['project.docker.latesttag.version'];
-                            </source>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+                       <plugin>
+                               <groupId>org.codehaus.groovy.maven</groupId>
+                               <artifactId>gmaven-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>execute</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <source>${basedir}/../src/main/scripts/TagVersion.groovy</source>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <plugin>
                                <artifactId>maven-resources-plugin</artifactId>
                                <version>2.6</version>
                                <artifactId>exec-maven-plugin</artifactId>
                                <version>1.5.0</version>
                                <executions>
-                                       <execution>
-                                               <id>Make-stage-dir</id>
-                                               <phase>generate-sources</phase>
-                                               <goals>
-                                                       <goal>exec</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <executable>/bin/mkdir</executable>
-                                                       <arguments>
-                                                       <argument>-p</argument>
-                                                       <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
-                                                       </arguments>
-                                               </configuration>
-                                       </execution>
-                                       <execution>
-                                               <id>Unzip dgbuilder</id>
-                                               <phase>generate-sources</phase>
-                                               <goals>
-                                                       <goal>exec</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <executable>/usr/bin/unzip</executable>
-                                                       <arguments>
-                                                       <argument>-d</argument>
-                                                       <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
-                                                       <argument>../dgbuilder/target/*.zip</argument>
-                                                       </arguments>
-                                               </configuration>
-                                       </execution>
+                                       <execution>
+                                               <id>Make-stage-dir</id>
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>exec</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <executable>/bin/mkdir</executable>
+                                                       <arguments>
+                                                               <argument>-p</argument>
+                                                               <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
+                                                       </arguments>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>Unzip dgbuilder</id>
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>exec</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <executable>/usr/bin/unzip</executable>
+                                                       <arguments>
+                                                               <argument>-d</argument>
+                                                               <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
+                                                               <argument>../dgbuilder/target/*.zip</argument>
+                                                       </arguments>
+                                               </configuration>
+                                       </execution>
                                        <execution>
                                                <id>Copy dgbuilder</id>
                                                <phase>generate-sources</phase>
 
                                        <execution>
                                                <id>change shell permissions</id>
-                                               <phase>process-sources</phase>
+                                               <phase>process-sources</phase>
                                                <goals>
                                                        <goal>exec</goal>
                                                </goals>
                                </executions>
                        </plugin>
                </plugins>
-    </build>
+       </build>
 
        <profiles>
-        <profile>
-            <id>docker</id>
-            <build>
-                <plugins>
-                       <plugin>
-                               <groupId>io.fabric8</groupId>
-                               <artifactId>docker-maven-plugin</artifactId>
-                               <version>0.16.5</version>
-                               <inherited>false</inherited>
-                               <configuration>
+               <profile>
+                       <id>docker</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>io.fabric8</groupId>
+                                               <artifactId>docker-maven-plugin</artifactId>
+                                               <version>0.16.5</version>
+                                               <inherited>false</inherited>
+                                               <configuration>
 
-                                       <images>
-                                               <image>
-                                                       <name>${image.name}</name>
-                                                       <build>
-                                                               <cleanup>try</cleanup>
-                                                               <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
-                                                               <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
-                                                               <tags>
-                                                                       <tag>${project.version}</tag>
-                                                                       <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                                                       <tag>${project.docker.latesttag.version}</tag>
-                                                               </tags>
-                                                       </build>
-                                               </image>
-                                       </images>
-                               </configuration>
-                               <executions>
-                                       <execution>
-                                               <id>generate-images</id>
-                                               <phase>package</phase>
-                                               <goals>
-                                                       <goal>build</goal>
-                                               </goals>
-                                       </execution>
+                                                       <images>
+                                                               <image>
+                                                                       <name>${image.name}</name>
+                                                                       <build>
+                                                                               <cleanup>try</cleanup>
+                                                                               <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
+                                                                               <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
+                                                                               <tags>
+                                                                                       <tag>${project.docker.latestminortag.version}</tag>
+                                                                                       <tag>${project.docker.latestfulltag.version}</tag>
+                                                                                       <tag>${project.docker.latesttagtimestamp.version}</tag>
+                                                                               </tags>
+                                                                       </build>
+                                                               </image>
+                                                       </images>
+                                               </configuration>
+                                               <executions>
+                                                       <execution>
+                                                               <id>generate-images</id>
+                                                               <phase>package</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                               </goals>
+                                                       </execution>
 
-                                       <execution>
-                                               <id>push-images</id>
-                                               <phase>deploy</phase>
-                                               <goals>
-                                                       <goal>build</goal>
-                                                       <goal>push</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-               </plugins>
-       </build>
-        </profile>
-    </profiles>
+                                                       <execution>
+                                                               <id>push-images</id>
+                                                               <phase>deploy</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                                       <goal>push</goal>
+                                                               </goals>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+                               </plugins>
+                       </build>
+               </profile>
+       </profiles>
 </project>
index 675e37a..90ade01 100644 (file)
@@ -1,5 +1,5 @@
 # Base ubuntu with added packages needed for open ecomp
-FROM onap/ccsdk-ubuntu-image:${project.version}
+FROM onap/ccsdk-ubuntu-image:${project.docker.latestfulltag.version}
 MAINTAINER CCSDK  Team (onap-discuss@lists.onap.org)
 
 # copy onap
index 89207a9..58f71a9 100644 (file)
@@ -24,6 +24,7 @@
            <base.image.name>onap/ccsdk-odl-fluorine-alpine-image</base.image.name>
                <image.name>onap/ccsdk-odlsli-alpine-image</image.name>
                <ccsdk.project.version>${project.version}</ccsdk.project.version>
+               <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
                <ccsdk.features.version>${project.version}</ccsdk.features.version>
                <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
                <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
                                                        <goal>execute</goal>
                                                </goals>
                                                <configuration>
-                                                       <source>
-                                                               println project.properties['ccsdk.project.version'];
-                                                               def versionArray;
-                                                               if (project.properties['ccsdk.project.version'] != null ) {
-                                                                   versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                                               }
-
-                                                               if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                                               {
-                                                                   project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                                               } else {
-                                                                   project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                                               }
-
-                                                               println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
-                                                       </source>
+                                                       <source>${basedir}/../../src/main/scripts/TagVersion.groovy</source>
                                                </configuration>
                                        </execution>
                                </executions>
                                                                                <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
                                                                                <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
                                                                                <tags>
-                                                                                       <tag>${project.version}</tag>
-                                                                                       <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                                                                       <tag>${project.docker.latesttag.version}</tag>
+                                                                                       <tag>${project.docker.latestminortag.version}</tag>
+                                                                                       <tag>${project.docker.latestfulltag.version}</tag>
+                                                                                       <tag>${project.docker.latesttagtimestamp.version}</tag>
                                                                                </tags>
                                                                        </build>
                                                                </image>
index 47b1208..b905467 100644 (file)
@@ -1,5 +1,5 @@
 # Base ubuntu with added packages needed for open ecomp
-FROM ${base.image.name}:${project.version}
+FROM ${base.image.name}:${project.docker.latestfulltag.version}
 MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
 ENV ODL_HOME /opt/opendaylight
index 488692c..8b26b49 100644 (file)
@@ -24,6 +24,7 @@
            <base.image.name>onap/ccsdk-odl-fluorine-ubuntu-image</base.image.name>
                <image.name>onap/ccsdk-odlsli-image</image.name>
                <ccsdk.project.version>${project.version}</ccsdk.project.version>
+               <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
                <ccsdk.features.version>${project.version}</ccsdk.features.version>
                <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
                <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
                                                        <goal>execute</goal>
                                                </goals>
                                                <configuration>
-                                                       <source>
-                                                               println project.properties['ccsdk.project.version'];
-                                                               def versionArray;
-                                                               if (project.properties['ccsdk.project.version'] != null ) {
-                                                                   versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                                               }
-
-                                                               if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                                               {
-                                                                   project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                                               } else {
-                                                                   project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                                               }
-
-                                                               println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
-                                                       </source>
+                                                       <source>${basedir}/../../src/main/scripts/TagVersion.groovy</source>
                                                </configuration>
                                        </execution>
                                </executions>
                                                                                <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
                                                                                <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
                                                                                <tags>
-                                                                                       <tag>${project.version}</tag>
-                                                                                       <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                                                                       <tag>${project.docker.latesttag.version}</tag>
+                                                                                       <tag>${project.docker.latestminortag.version}</tag>
+                                                                                       <tag>${project.docker.latestfulltag.version}</tag>
+                                                                                       <tag>${project.docker.latesttagtimestamp.version}</tag>
                                                                                </tags>
                                                                        </build>
                                                                </image>
index 98f17e4..d5460e4 100644 (file)
@@ -1,5 +1,5 @@
 # Base ubuntu with added packages needed for open ecomp
-FROM ${base.image.name}:${project.version}
+FROM ${base.image.name}:${project.docker.latestfulltag.version}
 MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
 ENV ODL_HOME /opt/opendaylight
index 477effa..2d3083d 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<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">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.onap.ccsdk.distribution</groupId>
-        <artifactId>distribution-odl-fluorine</artifactId>
-        <version>0.4.1-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>distribution-odl-fluorine-alpine</artifactId>
-    <version>0.4.1-SNAPSHOT</version>
-    <packaging>pom</packaging>
-
-    <name>ccsdk-distribution :: opendaylight :: ${project.artifactId}</name>
-    <description>Creates OpenDaylight container</description>
-    <organization>
-        <name>ONAP</name>
-    </organization>
-
-    <properties>
-        <image.name>onap/ccsdk-odl-fluorine-alpine-image</image.name>
-        <ccsdk.project.version>${project.version}</ccsdk.project.version>
-        <ccsdk.opendaylight.version>0.9.1</ccsdk.opendaylight.version>
-        <ccsdk.mariadb-connector-java.version>2.1.1</ccsdk.mariadb-connector-java.version>
-        <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
-       <docker.push.phase>deploy</docker.push.phase>
-    </properties>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.opendaylight.integration</groupId>
-                <artifactId>karaf</artifactId>
-                <version>${ccsdk.opendaylight.version}</version>
-                <type>tar.gz</type>
-            </dependency>
-            <dependency>
-                <groupId>org.mariadb.jdbc</groupId>
-                <artifactId>mariadb-java-client</artifactId>
-                <version>${ccsdk.mariadb-connector-java.version}</version>
-                <type>jar</type>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <build>
-        <plugins>
-
-
-            <plugin>
-                <groupId>org.codehaus.groovy.maven</groupId>
-                <artifactId>gmaven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <source>
-                                println project.properties['ccsdk.project.version'];
-                                def versionArray;
-                                if (project.properties['ccsdk.project.version'] != null ) {
-                                versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                }
-
-                                if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                {
-                                project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                } else {
-                                project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
-                                }
-
-                                println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
-                            </source>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <version>3.0.0</version>
-                <executions>
-                    <execution>
-                        <id>get-odl-distribution</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>copy</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.opendaylight.integration</groupId>
-                                    <artifactId>karaf</artifactId>
-                                    <version>${ccsdk.opendaylight.version}</version>
-                                    <type>tar.gz</type>
-
-                                    <overWrite>true</overWrite>
-                                    <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
-                                </artifactItem>
-                            </artifactItems>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>true</overWriteSnapshots>
-                            <overWriteIfNewer>true</overWriteIfNewer>
-                        </configuration>
-                    </execution>
-
-                    <execution>
-                        <id>get-mariadb-connector-jar</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>copy</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.mariadb.jdbc</groupId>
-                                    <artifactId>mariadb-java-client</artifactId>
-                                    <version>${ccsdk.mariadb-connector-java.version}</version>
-                                    <type>jar</type>
-                                    <overWrite>true</overWrite>
-                                    <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
-                                </artifactItem>
-                            </artifactItems>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>true</overWriteSnapshots>
-                            <overWriteIfNewer>true</overWriteIfNewer>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>2.6</version>
-                <executions>
-                    <execution>
-                        <id>copy-dockerfile</id>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals><!-- here the phase you need -->
-                        <phase>validate</phase>
-                        <configuration>
-                            <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>src/main/docker</directory>
-                                    <includes>
-                                        <include>Dockerfile</include>
-                                    </includes>
-                                    <filtering>true</filtering>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-
-
-        </plugins>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>docker</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>io.fabric8</groupId>
-                        <artifactId>docker-maven-plugin</artifactId>
-                        <version>0.16.5</version>
-                        <inherited>false</inherited>
-                        <configuration>
-                            <images>
-                                <image>
-                                    <name>${image.name}</name>
-                                    <build>
-                                        <cleanup>try</cleanup>
-                                        <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
-                                        <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
-                                        <tags>
-                                            <tag>${project.version}</tag>
-                                            <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                            <tag>${project.docker.latesttag.version}</tag>
-                                        </tags>
-                                    </build>
-                                </image>
-                            </images>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <id>generate-images</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                </goals>
-                            </execution>
-
-                            <execution>
-                                <id>push-images</id>
-                                <phase>${docker.push.phase}</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                    <goal>push</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-
-                </plugins>
-            </build>
-        </profile>
-
-    </profiles>
+<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">
+       <modelVersion>4.0.0</modelVersion>
+
+       <parent>
+               <groupId>org.onap.ccsdk.distribution</groupId>
+               <artifactId>distribution-odl-fluorine</artifactId>
+               <version>0.4.1-SNAPSHOT</version>
+       </parent>
+
+       <artifactId>distribution-odl-fluorine-alpine</artifactId>
+       <version>0.4.1-SNAPSHOT</version>
+       <packaging>pom</packaging>
+
+       <name>ccsdk-distribution :: opendaylight :: ${project.artifactId}</name>
+       <description>Creates OpenDaylight container</description>
+       <organization>
+               <name>ONAP</name>
+       </organization>
+
+       <properties>
+               <image.name>onap/ccsdk-odl-fluorine-alpine-image</image.name>
+               <ccsdk.project.version>${project.version}</ccsdk.project.version>
+               <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
+               <ccsdk.opendaylight.version>0.9.1</ccsdk.opendaylight.version>
+               <ccsdk.mariadb-connector-java.version>2.1.1</ccsdk.mariadb-connector-java.version>
+               <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
+               <docker.push.phase>deploy</docker.push.phase>
+       </properties>
+
+       <dependencyManagement>
+               <dependencies>
+                       <dependency>
+                               <groupId>org.opendaylight.integration</groupId>
+                               <artifactId>karaf</artifactId>
+                               <version>${ccsdk.opendaylight.version}</version>
+                               <type>tar.gz</type>
+                       </dependency>
+                       <dependency>
+                               <groupId>org.mariadb.jdbc</groupId>
+                               <artifactId>mariadb-java-client</artifactId>
+                               <version>${ccsdk.mariadb-connector-java.version}</version>
+                               <type>jar</type>
+                       </dependency>
+               </dependencies>
+       </dependencyManagement>
+
+       <build>
+               <plugins>
+
+
+                       <plugin>
+                               <groupId>org.codehaus.groovy.maven</groupId>
+                               <artifactId>gmaven-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>execute</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <source>${basedir}/../../../src/main/scripts/TagVersion.groovy</source>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+
+
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-dependency-plugin</artifactId>
+                               <version>3.0.0</version>
+                               <executions>
+                                       <execution>
+                                               <id>get-odl-distribution</id>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>copy</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <artifactItems>
+                                                               <artifactItem>
+                                                                       <groupId>org.opendaylight.integration</groupId>
+                                                                       <artifactId>karaf</artifactId>
+                                                                       <version>${ccsdk.opendaylight.version}</version>
+                                                                       <type>tar.gz</type>
+
+                                                                       <overWrite>true</overWrite>
+                                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+                                                               </artifactItem>
+                                                       </artifactItems>
+                                                       <overWriteReleases>false</overWriteReleases>
+                                                       <overWriteSnapshots>true</overWriteSnapshots>
+                                                       <overWriteIfNewer>true</overWriteIfNewer>
+                                               </configuration>
+                                       </execution>
+
+                                       <execution>
+                                               <id>get-mariadb-connector-jar</id>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>copy</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <artifactItems>
+                                                               <artifactItem>
+                                                                       <groupId>org.mariadb.jdbc</groupId>
+                                                                       <artifactId>mariadb-java-client</artifactId>
+                                                                       <version>${ccsdk.mariadb-connector-java.version}</version>
+                                                                       <type>jar</type>
+                                                                       <overWrite>true</overWrite>
+                                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+                                                               </artifactItem>
+                                                       </artifactItems>
+                                                       <overWriteReleases>false</overWriteReleases>
+                                                       <overWriteSnapshots>true</overWriteSnapshots>
+                                                       <overWriteIfNewer>true</overWriteIfNewer>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-dockerfile</id>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals><!-- here the phase you need -->
+                                               <phase>validate</phase>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+                                                       <resources>
+                                                               <resource>
+                                                                       <directory>src/main/docker</directory>
+                                                                       <includes>
+                                                                               <include>Dockerfile</include>
+                                                                       </includes>
+                                                                       <filtering>true</filtering>
+                                                               </resource>
+                                                       </resources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+
+
+               </plugins>
+       </build>
+
+       <profiles>
+               <profile>
+                       <id>docker</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>io.fabric8</groupId>
+                                               <artifactId>docker-maven-plugin</artifactId>
+                                               <version>0.16.5</version>
+                                               <inherited>false</inherited>
+                                               <configuration>
+                                                       <images>
+                                                               <image>
+                                                                       <name>${image.name}</name>
+                                                                       <build>
+                                                                               <cleanup>try</cleanup>
+                                                                               <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
+                                                                               <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
+                                                                               <tags>
+                                                                                       <tag>${project.docker.latestminortag.version}</tag>
+                                                                                       <tag>${project.docker.latestfulltag.version}</tag>
+                                                                                       <tag>${project.docker.latesttagtimestamp.version}</tag>
+                                                                               </tags>
+                                                                       </build>
+                                                               </image>
+                                                       </images>
+                                               </configuration>
+                                               <executions>
+                                                       <execution>
+                                                               <id>generate-images</id>
+                                                               <phase>package</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                               </goals>
+                                                       </execution>
+
+                                                       <execution>
+                                                               <id>push-images</id>
+                                                               <phase>${docker.push.phase}</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                                       <goal>push</goal>
+                                                               </goals>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+
+                               </plugins>
+                       </build>
+               </profile>
+
+       </profiles>
 </project>
index dc7736d..a043e1e 100644 (file)
@@ -1,5 +1,5 @@
 # Base ubuntu with added packages needed for open ecomp
-FROM onap/ccsdk-alpine-image:${project.version}
+FROM onap/ccsdk-alpine-image:${project.docker.latestfulltag.version}
 MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
 ENV ODL_HOME /opt/opendaylight/current
index d184957..c48a415 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<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">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.onap.ccsdk.distribution</groupId>
-        <artifactId>distribution-odl-fluorine</artifactId>
-        <version>0.4.1-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>distribution-odl-fluorine-ubuntu</artifactId>
-    <version>0.4.1-SNAPSHOT</version>
-    <packaging>pom</packaging>
-
-    <name>ccsdk-distribution :: opendaylight :: ${project.artifactId}</name>
-    <description>Creates OpenDaylight container</description>
-    <organization>
-        <name>ONAP</name>
-    </organization>
-
-    <properties>
-        <image.name>onap/ccsdk-odl-fluorine-ubuntu-image</image.name>
-        <ccsdk.project.version>${project.version}</ccsdk.project.version>
-        <ccsdk.opendaylight.version>0.9.1</ccsdk.opendaylight.version>
-        <ccsdk.mariadb-connector-java.version>2.1.1</ccsdk.mariadb-connector-java.version>
-        <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
-       <docker.push.phase>deploy</docker.push.phase>
-    </properties>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.opendaylight.integration</groupId>
-                <artifactId>karaf</artifactId>
-                <version>${ccsdk.opendaylight.version}</version>
-                <type>tar.gz</type>
-            </dependency>
-            <dependency>
-                <groupId>org.mariadb.jdbc</groupId>
-                <artifactId>mariadb-java-client</artifactId>
-                <version>${ccsdk.mariadb-connector-java.version}</version>
-                <type>jar</type>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <build>
-        <plugins>
-
-
-            <plugin>
-                <groupId>org.codehaus.groovy.maven</groupId>
-                <artifactId>gmaven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>execute</goal>
-                        </goals>
-                        <configuration>
-                            <source>
-                                println project.properties['ccsdk.project.version'];
-                                def versionArray;
-                                if (project.properties['ccsdk.project.version'] != null ) {
-                                versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                }
-
-                                if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                {
-                                project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                } else {
-                                project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest";
-                                }
-
-                                println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
-                            </source>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <version>3.0.0</version>
-                <executions>
-                    <execution>
-                        <id>get-odl-distribution</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>copy</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.opendaylight.integration</groupId>
-                                    <artifactId>karaf</artifactId>
-                                    <version>${ccsdk.opendaylight.version}</version>
-                                    <type>tar.gz</type>
-
-                                    <overWrite>true</overWrite>
-                                    <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
-                                </artifactItem>
-                            </artifactItems>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>true</overWriteSnapshots>
-                            <overWriteIfNewer>true</overWriteIfNewer>
-                        </configuration>
-                    </execution>
-
-                    <execution>
-                        <id>get-mariadb-connector-jar</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>copy</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.mariadb.jdbc</groupId>
-                                    <artifactId>mariadb-java-client</artifactId>
-                                    <version>${ccsdk.mariadb-connector-java.version}</version>
-                                    <type>jar</type>
-                                    <overWrite>true</overWrite>
-                                    <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
-                                </artifactItem>
-                            </artifactItems>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>true</overWriteSnapshots>
-                            <overWriteIfNewer>true</overWriteIfNewer>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>2.6</version>
-                <executions>
-                    <execution>
-                        <id>copy-dockerfile</id>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals><!-- here the phase you need -->
-                        <phase>validate</phase>
-                        <configuration>
-                            <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
-                            <resources>
-                                <resource>
-                                    <directory>src/main/docker</directory>
-                                    <includes>
-                                        <include>Dockerfile</include>
-                                    </includes>
-                                    <filtering>true</filtering>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-
-
-        </plugins>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>docker</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>io.fabric8</groupId>
-                        <artifactId>docker-maven-plugin</artifactId>
-                        <version>0.16.5</version>
-                        <inherited>false</inherited>
-                        <configuration>
-                            <images>
-                                <image>
-                                    <name>${image.name}</name>
-                                    <build>
-                                        <cleanup>try</cleanup>
-                                        <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
-                                        <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
-                                        <tags>
-                                            <tag>${project.version}</tag>
-                                            <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                            <tag>${project.docker.latesttag.version}</tag>
-                                        </tags>
-                                    </build>
-                                </image>
-                            </images>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <id>generate-images</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                </goals>
-                            </execution>
-
-                            <execution>
-                                <id>push-images</id>
-                                <phase>${docker.push.phase}</phase>
-                                <goals>
-                                    <goal>build</goal>
-                                    <goal>push</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-
-                </plugins>
-            </build>
-        </profile>
-
-    </profiles>
+<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">
+       <modelVersion>4.0.0</modelVersion>
+
+       <parent>
+               <groupId>org.onap.ccsdk.distribution</groupId>
+               <artifactId>distribution-odl-fluorine</artifactId>
+               <version>0.4.1-SNAPSHOT</version>
+       </parent>
+
+       <artifactId>distribution-odl-fluorine-ubuntu</artifactId>
+       <version>0.4.1-SNAPSHOT</version>
+       <packaging>pom</packaging>
+
+       <name>ccsdk-distribution :: opendaylight :: ${project.artifactId}</name>
+       <description>Creates OpenDaylight container</description>
+       <organization>
+               <name>ONAP</name>
+       </organization>
+
+       <properties>
+               <image.name>onap/ccsdk-odl-fluorine-ubuntu-image</image.name>
+               <ccsdk.project.version>${project.version}</ccsdk.project.version>
+               <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
+               <ccsdk.opendaylight.version>0.9.1</ccsdk.opendaylight.version>
+               <ccsdk.mariadb-connector-java.version>2.1.1</ccsdk.mariadb-connector-java.version>
+               <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
+               <docker.push.phase>deploy</docker.push.phase>
+       </properties>
+
+       <dependencyManagement>
+               <dependencies>
+                       <dependency>
+                               <groupId>org.opendaylight.integration</groupId>
+                               <artifactId>karaf</artifactId>
+                               <version>${ccsdk.opendaylight.version}</version>
+                               <type>tar.gz</type>
+                       </dependency>
+                       <dependency>
+                               <groupId>org.mariadb.jdbc</groupId>
+                               <artifactId>mariadb-java-client</artifactId>
+                               <version>${ccsdk.mariadb-connector-java.version}</version>
+                               <type>jar</type>
+                       </dependency>
+               </dependencies>
+       </dependencyManagement>
+
+       <build>
+               <plugins>
+
+
+                       <plugin>
+                               <groupId>org.codehaus.groovy.maven</groupId>
+                               <artifactId>gmaven-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>execute</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <source>${basedir}/../../../src/main/scripts/TagVersion.groovy</source>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+
+
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-dependency-plugin</artifactId>
+                               <version>3.0.0</version>
+                               <executions>
+                                       <execution>
+                                               <id>get-odl-distribution</id>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>copy</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <artifactItems>
+                                                               <artifactItem>
+                                                                       <groupId>org.opendaylight.integration</groupId>
+                                                                       <artifactId>karaf</artifactId>
+                                                                       <version>${ccsdk.opendaylight.version}</version>
+                                                                       <type>tar.gz</type>
+
+                                                                       <overWrite>true</overWrite>
+                                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+                                                               </artifactItem>
+                                                       </artifactItems>
+                                                       <overWriteReleases>false</overWriteReleases>
+                                                       <overWriteSnapshots>true</overWriteSnapshots>
+                                                       <overWriteIfNewer>true</overWriteIfNewer>
+                                               </configuration>
+                                       </execution>
+
+                                       <execution>
+                                               <id>get-mariadb-connector-jar</id>
+                                               <phase>validate</phase>
+                                               <goals>
+                                                       <goal>copy</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <artifactItems>
+                                                               <artifactItem>
+                                                                       <groupId>org.mariadb.jdbc</groupId>
+                                                                       <artifactId>mariadb-java-client</artifactId>
+                                                                       <version>${ccsdk.mariadb-connector-java.version}</version>
+                                                                       <type>jar</type>
+                                                                       <overWrite>true</overWrite>
+                                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+                                                               </artifactItem>
+                                                       </artifactItems>
+                                                       <overWriteReleases>false</overWriteReleases>
+                                                       <overWriteSnapshots>true</overWriteSnapshots>
+                                                       <overWriteIfNewer>true</overWriteIfNewer>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-dockerfile</id>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals><!-- here the phase you need -->
+                                               <phase>validate</phase>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+                                                       <resources>
+                                                               <resource>
+                                                                       <directory>src/main/docker</directory>
+                                                                       <includes>
+                                                                               <include>Dockerfile</include>
+                                                                       </includes>
+                                                                       <filtering>true</filtering>
+                                                               </resource>
+                                                       </resources>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+
+
+
+               </plugins>
+       </build>
+
+       <profiles>
+               <profile>
+                       <id>docker</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>io.fabric8</groupId>
+                                               <artifactId>docker-maven-plugin</artifactId>
+                                               <version>0.16.5</version>
+                                               <inherited>false</inherited>
+                                               <configuration>
+                                                       <images>
+                                                               <image>
+                                                                       <name>${image.name}</name>
+                                                                       <build>
+                                                                               <cleanup>try</cleanup>
+                                                                               <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
+                                                                               <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
+                                                                               <tags>
+                                                                                       <tag>${project.docker.latestminortag.version}</tag>
+                                                                                       <tag>${project.docker.latestfulltag.version}</tag>
+                                                                                       <tag>${project.docker.latesttagtimestamp.version}</tag>
+                                                                               </tags>
+                                                                       </build>
+                                                               </image>
+                                                       </images>
+                                               </configuration>
+                                               <executions>
+                                                       <execution>
+                                                               <id>generate-images</id>
+                                                               <phase>package</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                               </goals>
+                                                       </execution>
+
+                                                       <execution>
+                                                               <id>push-images</id>
+                                                               <phase>${docker.push.phase}</phase>
+                                                               <goals>
+                                                                       <goal>build</goal>
+                                                                       <goal>push</goal>
+                                                               </goals>
+                                                       </execution>
+                                               </executions>
+                                       </plugin>
+
+                               </plugins>
+                       </build>
+               </profile>
+
+       </profiles>
 </project>
index 93811de..9c9fec0 100644 (file)
@@ -1,5 +1,5 @@
 # Base ubuntu with added packages needed for open ecomp
-FROM onap/ccsdk-ubuntu-image:${project.version}
+FROM onap/ccsdk-ubuntu-image:${project.docker.latestfulltag.version}
 MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
 ENV ODL_HOME /opt/opendaylight/current
index 019fcef..b6d2701 100644 (file)
@@ -18,6 +18,7 @@
     <properties>
         <image.name>onap/ccsdk-saltstack-server-image</image.name>
         <ccsdk.project.version>${project.version}</ccsdk.project.version>
+               <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
     </properties>
 
     <build>
                             <goal>execute</goal>
                         </goals>
                         <configuration>
-                            <source>
-                                println project.properties['ccsdk.project.version'];
-                                def versionArray;
-                                if ( project.properties['ccsdk.project.version'] != null ) {
-                                    versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                }
-
-                                if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                } else {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                }
-
-                                println 'New Tag for docker:' +
-                                project.properties['project.docker.latesttag.version'];
-                            </source>
+                                                       <source>${basedir}/../src/main/scripts/TagVersion.groovy</source>
                         </configuration>
                     </execution>
                 </executions>
                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
                                         <dockerFile>Dockerfile</dockerFile>
                                         <tags>
-                                            <tag>${project.version}</tag>
-                                            <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                            <tag>${project.docker.latesttag.version}</tag>
+                                                                                       <tag>${project.docker.latestminortag.version}</tag>
+                                                                                       <tag>${project.docker.latestfulltag.version}</tag>
+                                                                                       <tag>${project.docker.latesttagtimestamp.version}</tag>
                                         </tags>
                                     </build>
                                 </image>
diff --git a/src/main/scripts/TagVersion.groovy b/src/main/scripts/TagVersion.groovy
new file mode 100644 (file)
index 0000000..68a8b78
--- /dev/null
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CCSDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.ccsdk.distribution
+
+
+def versionArray;
+if ( project.properties['ccsdk.project.version'] != null ) {
+       versionArray = project.properties['ccsdk.project.version'].split('\\.');
+}
+
+if ( project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT") ) {
+       patchArray = versionArray[2].split('-');
+       project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest";
+       project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-latest";
+       project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-"+project.properties['ccsdk.build.timestamp'];
+} else {
+       project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
+       project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-latest";
+       project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-"+project.properties['ccsdk.build.timestamp'];
+}
index 8f17a98..c4f53b2 100644 (file)
@@ -21,6 +21,8 @@
     <properties>
         <image.name>onap/ccsdk-ubuntu-image</image.name>
         <ccsdk.project.version>${project.version}</ccsdk.project.version>
+        <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
+           <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
     </properties>
 
     <build>
                             <goal>execute</goal>
                         </goals>
                         <configuration>
-                            <source>
-                                println project.properties['ccsdk.project.version'];
-                                def versionArray;
-                                if ( project.properties['ccsdk.project.version'] != null ) {
-                                    versionArray = project.properties['ccsdk.project.version'].split('\\.');
-                                }
-
-                                if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
-                                {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                } else {
-                                    project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
-                                }
-
-                                println 'New Tag for docker:' +
-                                project.properties['project.docker.latesttag.version'];
-                            </source>
+                            <source>${basedir}/../src/main/scripts/TagVersion.groovy</source>
                         </configuration>
                     </execution>
                 </executions>
                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
                                         <dockerFile>Dockerfile</dockerFile>
                                         <tags>
-                                            <tag>${project.version}</tag>
-                                            <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
-                                            <tag>${project.docker.latesttag.version}</tag>
+                                            <tag>${project.docker.latestminortag.version}</tag>
+                                            <tag>${project.docker.latestfulltag.version}</tag>
+                                            <tag>${project.docker.latesttagtimestamp.version}</tag>
                                         </tags>
                                     </build>
                                 </image>

© 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