blob: b81009733dc3cf0dad1394411e0644f80af7c91a [file] [log] [blame]
Joey Armstrong4048c1f2022-12-17 22:24:42 -05001#!/bin/bash
Joey Armstrong6f63edf2024-01-12 11:30:08 -05002# Copyright 2017-2024 Open Networking Foundation (ONF) and the ONF Contributors
Matt Jeanneretc7b437c2019-05-13 12:33:08 -04003#
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