blob: 5ca794e40f679b25c6abfd2d549f7d6f3b91dd44 [file] [log] [blame]
Matt Jeanneretc7b437c2019-05-13 12:33:08 -04001#!/bin/bash
2# 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.
15
16HERE=$(pwd)
17OARS=$(find $DOWNLOAD_ROOT -name "*.oar")
18for oar in $OARS; do
19 cd $HERE
20 echo "Installing application '$oar'"
21 rm -rf $APP_INSTALL_ROOT
22 mkdir -p $APP_INSTALL_ROOT
23 cd $APP_INSTALL_ROOT
24 cp $oar $APP_INSTALL_ROOT
25 unzip -oq -d . $APP_INSTALL_ROOT/$(basename $oar)
26 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
34done