David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 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. |
alshabib | 7db1356 | 2017-01-09 21:21:34 -0800 | [diff] [blame] | 15 | |
David K. Bainbridge | f87a5c8 | 2017-08-11 11:04:57 -0700 | [diff] [blame] | 16 | HERE=$(pwd) |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 17 | OARS=$(find $DOWNLOAD_ROOT -name "*.oar") |
| 18 | for oar in $OARS; do |
David K. Bainbridge | f87a5c8 | 2017-08-11 11:04:57 -0700 | [diff] [blame] | 19 | cd $HERE |
David K. Bainbridge | b6f72c1 | 2017-08-22 13:22:23 -0700 | [diff] [blame] | 20 | echo "Installing application '$oar'" |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 21 | rm -rf $APP_INSTALL_ROOT |
| 22 | mkdir -p $APP_INSTALL_ROOT |
| 23 | cd $APP_INSTALL_ROOT |
| 24 | cp $oar $APP_INSTALL_ROOT |
David K. Bainbridge | 6c0dc88 | 2017-08-17 09:57:10 -0700 | [diff] [blame] | 25 | unzip -oq -d . $APP_INSTALL_ROOT/$(basename $oar) |
David K. Bainbridge | 9f2ec3c | 2017-08-10 09:13:18 -0700 | [diff] [blame] | 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 |
alshabib | 7db1356 | 2017-01-09 21:21:34 -0800 | [diff] [blame] | 34 | done |