1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monica_ynh.git synced 2024-09-03 19:46:23 +02:00

Remove git source

This commit is contained in:
yalh76 2021-06-10 23:51:39 +02:00
parent 348579d73b
commit 5ba9fc2a1a
4 changed files with 11 additions and 60 deletions

View file

@ -3,14 +3,14 @@
domain="domain.tld"
path="/path"
admin="john"
is_public=1 (PUBLIC|public=1|private=0)
language="fr"
is_public=1
dav_support=1
signup=0
two_factor=0
; Checks
pkg_linter=1
setup_sub_dir=0
setup_sub_dir=1
setup_root=1
setup_nourl=0
setup_private=1
@ -24,10 +24,8 @@
upgrade=1 from_commit=d03eaae18c5b99f7933ae18378d5567fc46389f5
backup_restore=1
multi_instance=1
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
# incorrect_path=1
port_already_use=0
change_url=0
change_url=1
;;; Options
Email=anmol@datamol.org
Notification=change

View file

@ -32,7 +32,6 @@ password=$(ynh_string_random --length=10)
dav_support=$YNH_APP_ARG_DAV_SUPPORT
signup=$YNH_APP_ARG_SIGNUP
two_factor=$YNH_APP_ARG_TWO_FACTOR
version=$(curl -s https://api.github.com/repos/monicahq/monica/releases/latest | grep 'tag_name' | cut -d\" -f4)
app=$YNH_APP_INSTANCE_NAME
@ -60,7 +59,6 @@ ynh_app_setting_set --app=$app --key=random_key --value=$random_key
ynh_app_setting_set --app=$app --key=dav_support --value=$dav_support
ynh_app_setting_set --app=$app --key=signup --value=$signup
ynh_app_setting_set --app=$app --key=two_factor --value=$two_factor
ynh_app_setting_set --app=$app --key=version --value=$version
#=================================================
# STANDARD MODIFICATIONS
@ -99,10 +97,7 @@ ynh_script_progression --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
git clone https://github.com/monicahq/monica.git $final_path
pushd "$final_path"
git checkout tags/$version
popd
ynh_setup_source --dest_dir="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"

View file

@ -7,7 +7,6 @@
#=================================================
source _common.sh
source ynh_package_version
source /usr/share/yunohost/helpers
#=================================================
@ -29,7 +28,6 @@ email=$(ynh_user_get_info --username=$admin --key=mail)
dav_support=$(ynh_app_setting_get --app=$app --key=dav_support)
signup=$(ynh_app_setting_get --app=$app --key=signup)
two_factor=$(ynh_app_setting_get --app=$app --key=two_factor)
version=$(curl -s https://api.github.com/repos/monicahq/monica/releases/latest | grep 'tag_name' | cut -d\" -f4)
#=================================================
# CHECK VERSION
@ -76,21 +74,18 @@ if ! ynh_permission_exists --permission="api"; then
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
fi
# Create a permission if needed
if ! ynh_permission_exists --permission="dav"; then
ynh_permission_create --permission="dav" --url="/dav" --allowed="visitors" --show_tile="false" --protected="true"
fi
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# CHECK VERSION NUMBER
#=================================================
abort_if_up_to_date
# previous function is what defines 'version', more precisely the 'previous version'
previous_version="${version}"
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -101,18 +96,8 @@ then
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
if git -C "$final_path" rev-parse --is-inside-work-tree` >/dev/null 2>/dev/null
then
pushd "$final_path"
git fetch
git checkout tags/$version
popd
else
ynh_setup_source --dest_dir="$final_path"
fi
ynh_setup_source --dest_dir="$final_path"
fi
ynh_app_setting_set --app=$app --key=version --value=$version
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"

View file

@ -1,27 +0,0 @@
#!/bin/bash
read_json () {
sudo python3 -c "import sys, json;print(json.load(open('$1'))['$2'])"
}
read_manifest () {
if [ -f '../manifest.json' ] ; then
read_json '../manifest.json' "$1"
else
read_json '../settings/manifest.json' "$1"
fi
}
abort_if_up_to_date () {
version=$(read_json "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" 'version' 2> /dev/null || echo '20160501-7')
last_version=$(read_manifest 'version')
if [ "${version}" = "${last_version}" ]; then
ynh_print_info "Up-to-date, nothing to do"
ynh_die "" 0
fi
}
ynh_version_gt ()
{
dpkg --compare-versions "$1" gt "$2"
}