From 84eab50f627a1a8c1a4362d373986718eefcecbc Mon Sep 17 00:00:00 2001
From: "Timoney, Dan (dt5972)" <dt5972@att.com>
Date: Fri, 22 Jun 2018 15:48:39 -0400
Subject: Add feature aggregator

Add feature aggregator ccsdk-sli-core-all to install all sli-core
features.

Change-Id: I11174fc693a9275d712312145c03abb0d4f88b41
Issue-ID: CCSDK-280
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
---
 .../src/assembly/assemble_installer_zip.xml        | 39 ++++++++++++++++++++++
 .../src/assembly/assemble_mvnrepo_zip.xml          | 29 ++++++++++++++++
 .../src/main/resources/scripts/install-feature.sh  | 18 ++++++++++
 3 files changed, 86 insertions(+)
 create mode 100755 features/installer/src/assembly/assemble_installer_zip.xml
 create mode 100755 features/installer/src/assembly/assemble_mvnrepo_zip.xml
 create mode 100644 features/installer/src/main/resources/scripts/install-feature.sh

(limited to 'features/installer/src')

diff --git a/features/installer/src/assembly/assemble_installer_zip.xml b/features/installer/src/assembly/assemble_installer_zip.xml
new file mode 100755
index 000000000..a6a22a9ba
--- /dev/null
+++ b/features/installer/src/assembly/assemble_installer_zip.xml
@@ -0,0 +1,39 @@
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+	<id>bin</id>
+
+	<formats>
+		<format>zip</format>
+	</formats>
+
+	<!--  we want "system" and related files right at the root level
+		  as this file is suppose to be unzip on top of a karaf
+		  distro. -->
+	<includeBaseDirectory>false</includeBaseDirectory>
+
+	<fileSets>
+		<fileSet>
+			<directory>target/stage/</directory>
+			<outputDirectory>${application.name}</outputDirectory>
+			<fileMode>755</fileMode>
+			<includes>
+				<include>*.sh</include>
+			</includes>
+		</fileSet>
+		<fileSet>
+			<directory>target/stage/</directory>
+			<outputDirectory>${application.name}</outputDirectory>
+			<fileMode>644</fileMode>
+			<excludes>
+				<exclude>*.sh</exclude>
+			</excludes>
+		</fileSet>
+	</fileSets>
+
+
+
+</assembly>
diff --git a/features/installer/src/assembly/assemble_mvnrepo_zip.xml b/features/installer/src/assembly/assemble_mvnrepo_zip.xml
new file mode 100755
index 000000000..86b07f1f3
--- /dev/null
+++ b/features/installer/src/assembly/assemble_mvnrepo_zip.xml
@@ -0,0 +1,29 @@
+<!-- Defines how we build the .zip file which is our distribution. -->
+
+<assembly
+	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+	<id>repo</id>
+
+	<formats>
+		<format>zip</format>
+	</formats>
+
+	<!--  we want "system" and related files right at the root level
+		  as this file is suppose to be unzip on top of a karaf
+		  distro. -->
+	<includeBaseDirectory>false</includeBaseDirectory>
+
+	<fileSets>
+		<fileSet>
+			<directory>target/assembly/</directory>
+			<outputDirectory>.</outputDirectory>
+			<excludes>
+			</excludes>
+		</fileSet>
+	</fileSets>
+
+
+
+</assembly>
diff --git a/features/installer/src/main/resources/scripts/install-feature.sh b/features/installer/src/main/resources/scripts/install-feature.sh
new file mode 100644
index 000000000..e16e79a12
--- /dev/null
+++ b/features/installer/src/main/resources/scripts/install-feature.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
+ODL_KARAF_CLIENT=${ODL_KARAF_CLIENT:-${ODL_HOME}/bin/client}
+INSTALLERDIR=$(dirname $0)
+
+REPOZIP=${INSTALLERDIR}/${features.boot}-${project.version}.zip
+
+if [ -f ${REPOZIP} ]
+then
+	unzip -d ${ODL_HOME} ${REPOZIP}
+else
+	echo "ERROR : repo zip ($REPOZIP) not found"
+	exit 1
+fi
+
+${ODL_KARAF_CLIENT} feature:repo-add ${features.repositories}
+${ODL_KARAF_CLIENT} feature:install ${features.boot}
-- 
cgit