[enh] Support new env. vars. in install script

This commit is contained in:
Julien Malik 2016-03-18 17:31:44 +01:00
parent a5fbda0bc7
commit f506747fac
3 changed files with 18 additions and 7 deletions

View File

@ -12,7 +12,7 @@
"email": "john.doe@example.com", "email": "john.doe@example.com",
"url": "http://example.com" "url": "http://example.com"
}, },
"multi_instance": "false", "multi_instance": "true",
"services": [ "services": [
"nginx", "nginx",
"php5-fpm", "php5-fpm",

View File

@ -3,13 +3,23 @@
# causes the shell to exit if any subcommand or pipeline returns a non-zero status # causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e set -e
app=ynhexample # This is a multi-instance app, meaning it can be installed several times independently
# The id of the app as stated in the manifest is available as $YNH_APP_ID
# The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...)
# The app instance name is available as $YNH_APP_INSTANCE_NAME
# - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample
# - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2
# - ynhexample__{N} for the subsequent installations, with N=3,4, ...
# The app instance name is probably what you are interested the most, since this is
# guaranteed to be unique. This is a good unique identifier to define installation path,
# db names, ...
app=$YNH_APP_INSTANCE_NAME
# Retrieve arguments # Retrieve arguments
domain=$1 domain=$YNH_APP_ARG_DOMAIN
path=$2 path=$YNH_APP_ARG_PATH
admin=$3 admin=$YNH_APP_ARG_ADMIN
is_public=$4 is_public=$YNH_APP_ARG_IS_PUBLIC
# Save app settings # Save app settings
sudo yunohost app setting $app admin -v "$admin" sudo yunohost app setting $app admin -v "$admin"

View File

@ -3,7 +3,8 @@
# causes the shell to exit if any subcommand or pipeline returns a non-zero status # causes the shell to exit if any subcommand or pipeline returns a non-zero status
set -e set -e
app=ynhexample # See comments in install script
app=$YNH_APP_INSTANCE_NAME
# Retrieve arguments # Retrieve arguments
domain=$(sudo yunohost app setting $app domain) domain=$(sudo yunohost app setting $app domain)