blob: 3cbfe152b386110b933e2a043477b66430ab48c2 [file] [log] [blame]
pierventre16709162020-07-16 20:48:24 +02001#!/bin/bash
2#
3# Copyright 2020-present Open Networking Foundation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17
18HERE=$(pwd)
19OARS=$(find $DOWNLOAD_ROOT -name "*.oar")
20for oar in $OARS; do
21 cd $HERE
22 echo "Installing application '$oar'"
23 rm -rf $APP_INSTALL_ROOT
24 mkdir -p $APP_INSTALL_ROOT
25 cd $APP_INSTALL_ROOT
26 cp $oar $APP_INSTALL_ROOT
27 unzip -oq -d . $APP_INSTALL_ROOT/$(basename $oar)
28 name=$(grep "name=" $APP_INSTALL_ROOT/app.xml | sed 's/<app name="//g;s/".*//g')
29 mkdir -p $APPS_ROOT/$name
30 cp $APP_INSTALL_ROOT/app.xml $APPS_ROOT/$name/app.xml
31 touch $APPS_ROOT/$name/active
32 [ -f $APP_INSTALL_ROOT/app.png ] && cp $APP_INSTALL_ROOT/app.png $APPS_ROOT/$name/app.png
33 cp $APP_INSTALL_ROOT/$(basename $oar) $APPS_ROOT/$name/$name.oar
34 cp -rf $APP_INSTALL_ROOT/m2/* $KARAF_M2
35 rm -rf $APP_INSTALL_ROOT
36done