pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 1 | #!/bin/bash |
pierventre | 8361142 | 2020-08-14 22:53:15 +0200 | [diff] [blame] | 2 | |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 3 | # |
| 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 | |
| 19 | HERE=$(pwd) |
pierventre | 8361142 | 2020-08-14 22:53:15 +0200 | [diff] [blame] | 20 | OARS=$(find "$DOWNLOAD_ROOT" -name "*.oar") |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 21 | for oar in $OARS; do |
pierventre | 8361142 | 2020-08-14 22:53:15 +0200 | [diff] [blame] | 22 | cd "$HERE" || exit 1 |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 23 | echo "Installing application '$oar'" |
pierventre | 8361142 | 2020-08-14 22:53:15 +0200 | [diff] [blame] | 24 | 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" |
pierventre | 1670916 | 2020-07-16 20:48:24 +0200 | [diff] [blame] | 36 | done |