Joey Armstrong | 4048c1f | 2022-12-17 22:24:42 -0500 | [diff] [blame] | 1 | #!/bin/bash |
Joey Armstrong | 695ba5c | 2023-01-20 11:17:49 -0500 | [diff] [blame] | 2 | # Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Matt Jeanneret | c7b437c | 2019-05-13 12:33:08 -0400 | [diff] [blame] | 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 | |
| 16 | HERE=$(pwd) |
| 17 | OARS=$(find $DOWNLOAD_ROOT -name "*.oar") |
| 18 | for 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 |
| 34 | done |