1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/prettynoemiecms_ynh.git synced 2024-09-03 20:06:36 +02:00

Working on install

This commit is contained in:
massyas 2018-04-27 08:45:18 +02:00
parent 9383a1f585
commit 7050b90a40
2 changed files with 21 additions and 40 deletions

View file

@ -1,18 +1,18 @@
{ {
"name": "YunoHost example app", "name": "PrettyNoemie CMS app",
"id": "ynhexample", "id": "prettynoemiecms",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Example package for YunoHost application.", "en": "PrettyNoemie CMS package for YunoHost application.",
"fr": "Exemple de package dapplication pour YunoHost." "fr": "Package dapplication PrettyNoemie CMS pour YunoHost."
}, },
"version": "1.0", "version": "1.0",
"url": "https://example.com", "url": "https://framagit.org/framasoft/PrettyNoemieCMS",
"license": "free", "license": "GNU Affero General Public License v3.0",
"maintainer": { "maintainer": {
"name": "John doe", "name": "John doe",
"email": "john.doe@example.com", "email": "john.doe@example.com",
"url": "http://example.com" "url": "https://framagit.org/framasoft/PrettyNoemieCMS"
}, },
"requirements": { "requirements": {
"yunohost": ">= 2.7.2" "yunohost": ">= 2.7.2"
@ -20,8 +20,7 @@
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php5-fpm", "php5-fpm"
"mysql"
], ],
"arguments": { "arguments": {
"install" : [ "install" : [
@ -29,8 +28,8 @@
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": { "ask": {
"en": "Choose a domain name for ynhexample", "en": "Choose a domain name for prettynoemiecms",
"fr": "Choisissez un nom de domaine pour ynhexample" "fr": "Choisissez un nom de domaine pour prettynoemiecms"
}, },
"example": "example.com" "example": "example.com"
}, },
@ -38,11 +37,11 @@
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": { "ask": {
"en": "Choose a path for ynhexample", "en": "Choose a path for prettynoemiecms",
"fr": "Choisissez un chemin pour ynhexample" "fr": "Choisissez un chemin pour prettynoemiecms"
}, },
"example": "/example", "example": "/prettynoemiecms",
"default": "/example" "default": "/prettynoemiecms"
}, },
{ {
"name": "admin", "name": "admin",
@ -61,15 +60,6 @@
"fr": "Est-ce une application publique ?" "fr": "Est-ce une application publique ?"
}, },
"default": true "default": true
},
{
"name": "language",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": ["fr", "en"],
"default": "fr"
} }
] ]
} }

View file

@ -24,7 +24,6 @@ domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
# This is a multi-instance app, meaning it can be installed several times independently # 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 id of the app as stated in the manifest is available as $YNH_APP_ID
@ -61,7 +60,6 @@ ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app path $path_url ynh_app_setting_set $app path $path_url
ynh_app_setting_set $app admin $admin ynh_app_setting_set $app admin $admin
ynh_app_setting_set $app is_public $is_public ynh_app_setting_set $app is_public $is_public
ynh_app_setting_set $app language $language
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -79,17 +77,7 @@ ynh_app_setting_set $app port $port
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_install_app_dependencies deb1 deb2 ynh_install_app_dependencies git
#=================================================
# CREATE A MYSQL DATABASE
#=================================================
# If your app uses a MySQL database, you can use these lines to bootstrap
# a database, an associated user and save the password in app settings
db_name=$(ynh_sanitize_dbid $app)
ynh_app_setting_set $app db_name $db_name
ynh_mysql_setup_db $db_name $db_name
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -97,7 +85,10 @@ ynh_mysql_setup_db $db_name $db_name
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app final_path $final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path" #ynh_setup_source "$final_path"
git clone "https://framagit.org/framasoft/PrettyNoemieCMS" "$final_path"
cd "$final_path"
composer install
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -149,13 +140,13 @@ yunohost app ssowatconf
systemctl reload nginx systemctl reload nginx
# Installation with curl # Installation with curl
ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" #ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE" #ynh_replace_string "match_string" "replace_string" "$final_path/CONFIG_FILE"
#================================================= #=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE # STORE THE CHECKSUM OF THE CONFIG FILE