blob: 5ca794e40f679b25c6abfd2d549f7d6f3b91dd44 [file] [log] [blame]
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -07001#!/bin/bash
Zack Williams41513bf2018-07-07 20:08:35 -07002# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
alshabib7db13562017-01-09 21:21:34 -080015
David K. Bainbridgef87a5c82017-08-11 11:04:57 -070016HERE=$(pwd)
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070017OARS=$(find $DOWNLOAD_ROOT -name "*.oar")
18for oar in $OARS; do
David K. Bainbridgef87a5c82017-08-11 11:04:57 -070019 cd $HERE
David K. Bainbridgeb6f72c12017-08-22 13:22:23 -070020 echo "Installing application '$oar'"
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070021 rm -rf $APP_INSTALL_ROOT
22 mkdir -p $APP_INSTALL_ROOT
23 cd $APP_INSTALL_ROOT
24 cp $oar $APP_INSTALL_ROOT
David K. Bainbridge6c0dc882017-08-17 09:57:10 -070025 unzip -oq -d . $APP_INSTALL_ROOT/$(basename $oar)
David K. Bainbridge9f2ec3c2017-08-10 09:13:18 -070026 name=$(grep "name=" $APP_INSTALL_ROOT/app.xml | sed 's/<app name="//g;s/".*//g')
27 mkdir -p $APPS_ROOT/$name
28 cp $APP_INSTALL_ROOT/app.xml $APPS_ROOT/$name/app.xml
29 touch $APPS_ROOT/$name/active
30 [ -f $APP_INSTALL_ROOT/app.png ] && cp $APP_INSTALL_ROOT/app.png $APPS_ROOT/$name/app.png
31 cp $APP_INSTALL_ROOT/$(basename $oar) $APPS_ROOT/$name/$name.oar
32 cp -rf $APP_INSTALL_ROOT/m2/* $KARAF_M2
33 rm -rf $APP_INSTALL_ROOT
alshabib7db13562017-01-09 21:21:34 -080034done