From 38ae48ff7d4f918e76bd0da813e4eacd9afeace7 Mon Sep 17 00:00:00 2001 From: "ma.azimi@laposte.net" Date: Wed, 24 Feb 2016 23:30:16 +0100 Subject: [PATCH] Add packaging_apps_multiinstance.md --- packaging_apps_multiinstance.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packaging_apps_multiinstance.md diff --git a/packaging_apps_multiinstance.md b/packaging_apps_multiinstance.md new file mode 100644 index 00000000..04fb3a57 --- /dev/null +++ b/packaging_apps_multiinstance.md @@ -0,0 +1,20 @@ +Application packaging + +### Multi-instance +Multi-instance is application capacity to be installed many times. + +#### Scripts +When YunoHost install a second time the application, it give to the script at last argument `id__2` with the application `id` comming from the manifest. The value `n` in `id__n` is incremented at each new instance of the application. + +**E.g.** in the roundcube script, database is called `roundcube`, the install directory `roundcube` and the [Nginx configuration](packaging_apps_nginx_conf_en) `roundcube`. This way, the second instance of roundcube will not conflict with the first one, and will be installed in the `roundcube__2` database, in the `roundcube__2`directory, and with the `roundcube__2` Nginx configuration. + +Retrieve last variable gived to scripts: +```bash +APP=${!#} +``` + +#### Manifest +Set `multi_instance` variable to `true` in the [manifest](packaging_apps_manifest_en): +```json + "multi_instance": "true", +``` \ No newline at end of file