David K. Bainbridge | 251024b | 2017-08-10 09:11:23 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
David K. Bainbridge | e26c870 | 2017-08-11 11:04:39 -0700 | [diff] [blame] | 3 | HERE=$(pwd) |
David K. Bainbridge | 251024b | 2017-08-10 09:11:23 -0700 | [diff] [blame] | 4 | for app in $APPS; do |
David K. Bainbridge | e26c870 | 2017-08-11 11:04:39 -0700 | [diff] [blame] | 5 | cd $HERE |
David K. Bainbridge | 251024b | 2017-08-10 09:11:23 -0700 | [diff] [blame] | 6 | echo "Installing application '$app'" |
| 7 | oar=$(find $BUILD_ROOT -path "*/target/*" -name "$app*".oar) |
| 8 | if [ "$oar x" == " x" ]; then |
| 9 | echo "Required application, $app, not found." |
David K. Bainbridge | e26c870 | 2017-08-11 11:04:39 -0700 | [diff] [blame] | 10 | exit 1 |
David K. Bainbridge | 251024b | 2017-08-10 09:11:23 -0700 | [diff] [blame] | 11 | fi |
| 12 | rm -rf $APP_INSTALL_ROOT |
| 13 | mkdir -p $APP_INSTALL_ROOT |
| 14 | cd $APP_INSTALL_ROOT |
| 15 | cp $oar $APP_INSTALL_ROOT |
David K. Bainbridge | 56da957 | 2017-08-17 09:56:50 -0700 | [diff] [blame] | 16 | unzip -oq -d . $APP_INSTALL_ROOT/$(basename $oar) |
David K. Bainbridge | 251024b | 2017-08-10 09:11:23 -0700 | [diff] [blame] | 17 | name=$(grep "name=" $APP_INSTALL_ROOT/app.xml | sed 's/<app name="//g;s/".*//g') |
| 18 | mkdir -p $APPS_ROOT/$name |
| 19 | cp $APP_INSTALL_ROOT/app.xml $APPS_ROOT/$name/app.xml |
| 20 | touch $APPS_ROOT/$name/active |
| 21 | [ -f $APP_INSTALL_ROOT/app.png ] && cp $APP_INSTALL_ROOT/app.png $APPS_ROOT/$name/app.png |
| 22 | cp $APP_INSTALL_ROOT/$(basename $oar) $APPS_ROOT/$name/$name.oar |
| 23 | cp -rf $APP_INSTALL_ROOT/m2/* $KARAF_M2 |
| 24 | rm -rf $APP_INSTALL_ROOT |
| 25 | done |