1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Get version from manifest

This commit is contained in:
Josué Tille 2017-10-31 22:33:02 +01:00
parent fc2fa5c017
commit aca24e321b
4 changed files with 13 additions and 4 deletions

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/Josue-T/synapse_python_build/releases/download/v0.24.1/matrix-synapse_0.24.1-bin1_armv7l.tar.gz
SOURCE_URL=https://github.com/Josue-T/synapse_python_build/releases/download/v__APP_VERSION__/matrix-synapse___APP_VERSION__-bin1_armv7l.tar.gz
SOURCE_SUM=20b6b3b195210aa778a017796a310b4327d8ecbd1b423214e83603aae319957c
# (Optional) Program to check the integrity (sha256sum, md5sum...)
# default: sha256

View file

@ -5,7 +5,15 @@ app=$YNH_APP_INSTANCE_NAME
synapse_user="matrix-synapse"
synapse_db_name="matrix_synapse"
synapse_db_user="matrix_synapse"
synapse_version="0.24.1"
get_app_version_from_json() {
manifest_path="../manifest.json"
if [ ! -e "$manifest_path" ]; then
manifest_path="../settings/manifest.json" # Into the restore script, the manifest is not at the same place
fi
echo $(grep '\"version\": ' "$manifest_path" | cut -d '"' -f 4) # Retrieve the version number in the manifest file.
}
APP_VERSION=$(get_app_version_from_json)
install_dependances() {
ynh_install_app_dependencies coturn build-essential python2.7-dev libffi-dev python-pip python-setuptools sqlite3 libssl-dev python-virtualenv libxml2-dev libxslt1-dev python-lxml libjpeg-dev libpq-dev postgresql
@ -24,6 +32,7 @@ setup_dir() {
install_source() {
if [ -n "$(uname -m | grep arm)" ]
then
ynh_replace_string __APP_VERSION__ $APP_VERSION "$YNH_CWD/../conf/${src_id}.src"
ynh_setup_source $final_path/ "armv7"
else
# Install virtualenv if it don't exist

View file

@ -41,7 +41,7 @@ synapse_db_pwd=$(ynh_string_random 30)
ynh_app_setting_set $app special_domain $domain
ynh_app_setting_set $app special_path $path
ynh_app_setting_set $app final_path $final_path
ynh_app_setting_set $app synapse_version $synapse_version
ynh_app_setting_set $app synapse_version $APP_VERSION
ynh_app_setting_set $app synapse_db_pwd $synapse_db_pwd
ynh_app_setting_set $app is_public $is_public
ynh_app_setting_set $app synapse_port $synapse_port

View file

@ -134,7 +134,7 @@ set_certificat_access
config_coturn
# Set new settings
ynh_app_setting_set $app synapse_version $synapse_version
ynh_app_setting_set $app synapse_version $APP_VERSION
# Recharge la configuration Nginx
systemctl reload nginx.service