Add distribution nonrtric

distribution based on sdnc frankfurt

Issue-ID: OAM-61
Signed-off-by: herbert <herbert.eiselt@highstreet-technologies.com>
Change-Id: I0af2e38d2af5f41b10451772a2c60d80b0dc0a54
Signed-off-by: herbert <herbert.eiselt@highstreet-technologies.com>
diff --git a/distribution/README.md b/distribution/README.md
index 7fe48e3..8e6348e 100644
--- a/distribution/README.md
+++ b/distribution/README.md
@@ -1,3 +1,3 @@
 # Distribution
 
-This directory contains OAM related software artifacts realted to the packaging and distributing code.
\ No newline at end of file
+This directory contains OAM related software artifacts realted to the packaging and distributing code.
diff --git a/distribution/nonrtric-o1-controller-frankfurt/pom.xml b/distribution/nonrtric-o1-controller-frankfurt/pom.xml
new file mode 100644
index 0000000..ae18224
--- /dev/null
+++ b/distribution/nonrtric-o1-controller-frankfurt/pom.xml
@@ -0,0 +1,163 @@
+<?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.parent</groupId>
+    <artifactId>odlparent-lite</artifactId>
+    <version>1.5.2-SNAPSHOT</version>
+    <relativePath />
+  </parent>
+
+  <groupId>org.o-ran-sc.oam.distribution</groupId>
+  <artifactId>nonrtric-o1-controller</artifactId>
+  <version>1.8.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>sdnc-distribution :: o-ran-sc :: nonrtric-o1-controller</name>
+
+  <description>nonrtric-o1-controller based on ONAP SDNC</description>
+
+  <organization>
+    <name>O-RAN-SC/OAM</name>
+  </organization>
+
+  <properties>
+    <base.image.repo>nexus3.onap.org:10001/onap/sdnc-image:1.8.0-STAGING-20200225T124813Z</base.image.repo>
+    <image.name>o-ran-sc/${project.artifactId}</image.name>
+    <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
+    <o-ran-sc.project.version>${project.version}</o-ran-sc.project.version>
+    <o-ran-sc.features.version>0.7.1-SNAPSHOT</o-ran-sc.features.version>
+    <features.repo>mvn:org.o-ran-sc.oam.features.devicemanager/devicemanager-oran-ru-fh-feature/${o-ran-sc.features.version}/xml/features, mvn:org.o-ran-sc.oam.features.devicemanager/devicemanager-xran-ru-fh-feature/${o-ran-sc.features.version}/xml/features</features.repo>
+    <features.boot>sdnr-wt-feature-aggregator,devicemanager-oran-ru-fh-feature</features.boot>
+    <platform-logic-installer.version>${project.version}</platform-logic-installer.version>
+    <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
+    <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
+    <opendaylight.root>opt/opendaylight</opendaylight.root>
+    <docker.push.phase>deploy</docker.push.phase>
+    <docker.verbose>true</docker.verbose>
+
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.o-ran-sc.oam.features.devicemanager</groupId>
+      <artifactId>devicemanager-oran-ru-fh-installer</artifactId>
+      <version>${o-ran-sc.features.version}</version>
+      <type>zip</type>
+      <classifier>repo</classifier>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.groovy.maven</groupId>
+        <artifactId>gmaven-plugin</artifactId>
+        <version>1.0</version>
+        <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>
+        <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>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>unpack features</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>unpack-dependencies</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
+              <excludeTransitive>true</excludeTransitive>
+              <overWriteReleases>false</overWriteReleases>
+              <overWriteSnapshots>true</overWriteSnapshots>
+              <overWriteIfNewer>true</overWriteIfNewer>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>io.fabric8</groupId>
+        <artifactId>docker-maven-plugin</artifactId>
+        <version>0.28.0</version>
+        <inherited>false</inherited>
+        <configuration>
+          <images>
+            <image>
+              <name>${image.name}</name>
+              <build>
+                <cleanup>try</cleanup>
+                <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
+                <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>
+    <extensions>
+      <extension><!-- this extension is required by wagon in order to pass the proxy -->
+        <groupId>org.apache.maven.wagon</groupId>
+        <artifactId>wagon-http-lightweight</artifactId>
+        <version>2.2</version>
+      </extension>
+    </extensions>
+  </build>
+</project>
diff --git a/distribution/nonrtric-o1-controller-frankfurt/src/main/docker/Dockerfile b/distribution/nonrtric-o1-controller-frankfurt/src/main/docker/Dockerfile
new file mode 100644
index 0000000..9df3280
--- /dev/null
+++ b/distribution/nonrtric-o1-controller-frankfurt/src/main/docker/Dockerfile
@@ -0,0 +1,12 @@
+# Base odl alpine with added packages needed for
+FROM ${base.image.repo}
+ENV SDNR_ORAN_REPO ${features.repo}
+RUN sed -i -e "\|featuresRepositories|s|$|,${SDNR_ORAN_REPO}|"  $ODL_HOME/etc/org.apache.karaf.features.cfg
+ENV SDNRWT_BOOTFEATURES ${features.boot}
+
+USER root
+# copy CCSDK mvn artifacts to ODL repository
+COPY system /tmp/system
+RUN rsync -a /tmp/system $ODL_HOME && rm -rf /tmp/system
+RUN chown -R odl:odl $ODL_HOME
+USER odl
diff --git a/distribution/nonrtric-o1-controller-frankfurt/src/main/scripts/TagVersion.groovy b/distribution/nonrtric-o1-controller-frankfurt/src/main/scripts/TagVersion.groovy
new file mode 100644
index 0000000..e2c317d
--- /dev/null
+++ b/distribution/nonrtric-o1-controller-frankfurt/src/main/scripts/TagVersion.groovy
@@ -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.oransc.oam.distribution
+
+
+def versionArray;
+if ( project.properties['o-ran-sc.project.version'] != null ) {
+	versionArray = project.properties['o-ran-sc.project.version'].split('\\.');
+}
+
+if ( project.properties['o-ran-sc.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'];
+}
diff --git a/distribution/nonrtric-o1-controller/README.md b/distribution/nonrtric-o1-controller/README.md
deleted file mode 100644
index c416175..0000000
--- a/distribution/nonrtric-o1-controller/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-## Distribution
-
- This directory contains OAM related software artifacts realted to the packaging and distributing code.
\ No newline at end of file
diff --git a/distribution/pom.xml b/distribution/pom.xml
deleted file mode 100644
index eefca7c..0000000
--- a/distribution/pom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-################################################################################
-# Copyright 2019 highstreet technologies and others
-#
-# 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.
-#
--->
-<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>
-
-  <groupId>org.o-ran-sc.oam</groupId>
-  <artifactId>nonrtric-o1</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
-  <packaging>pom</packaging>
-
-  <name>nonrtric-o1</name>
-  <modules>
-    <module>nonrtric-o1-controller</module>
-  </modules>
-</project>