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