Added postinstall script.

Fixes:
  * feature #1507: Adds information on how to install bundle gems
  * feature #1506: Information on dependencies is also printed

Partialy fixes:
  * feature #1505: adds plugins and server classes to sunstone
This commit is contained in:
Javi Fontan committed 2012-09-25 19:13:28 +02:00
1 parent e67646a175
commit 590e8d51d7
1 file changed
+95
+95
View File
@@ -0,0 +1,95 @@
#!/bin/bash
SUNSTONE_PLUGINS=/etc/one/sunstone-plugins.yaml
SUNSTONE_SERVER=/etc/one/sunstone-server.conf
function print_install_message() {
cat <<EOT
OpenNebula Apps needs the folowing dependencies to run correctly:
* OpenNebula
* MongoDB. This database is needed for AppMarket. To install it
you can follow the instructions at
http://docs.mongodb.org/manual/installation/
* ruby and rubygems installed. This should be already installed
if you have already OpenNebula
* bundler. Needed for both AppFlow and AppMarket. To install it
you can issue:
# gem install bundler
* Required gems. To install the gems needed by AppFlow and
AppMarket do this:
# cd /usr/lib/one/oneapps/flow && bundle install
# cd /usr/lib/one/oneapps/market && bundle install
EOT
}
function add_config() {
name=$1
text=$2
config_file=$3
! grep -q -- "$name" $config_file && echo "$text" >> $config_file
}
function add_plugin() {
add_config "$1" "$2" "$SUNSTONE_PLUGINS"
}
function add_server() {
add_config "$1" "$2" "$SUNSTONE_SERVER"
}
add_plugin "apptools.appstage-dashboard.js" \
"- user-plugins/apptools.appstage-dashboard.js:
:user:
:group:
:ALL: true"
add_plugin "apptools.appstage.js" \
"- user-plugins/apptools.appstage.js:
:user:
:group:
:ALL: true"
add_plugin "apptools.appflow-dashboard.js" \
"- user-plugins/apptools.appflow-dashboard.js:
:group:
:ALL: true
:user:"
add_plugin "apptools.appflow.templates.js" \
"- user-plugins/apptools.appflow.templates.js:
:group:
:ALL: true
:user:"
add_plugin "apptools.appflow.services.js" \
"- user-plugins/apptools.appflow.services.js:
:group:
:ALL: true
:user:"
add_plugin "apptools.appmarket-dashboard.js" \
"- user-plugins/apptools.appmarket-dashboard.js:
:group:
:ALL: true
:user:"
add_plugin "apptools.appmarket.appliances.js" \
"- user-plugins/apptools.appmarket.appliances.js:
:group:
:ALL: true
:user:"
add_server "- appstage" " - appstage"
add_server "- appflow" " - appflow"
add_server "- appmarket" " - appmarket"
print_install_message