1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab_ynh.git synced 2024-09-03 18:36:35 +02:00

use ynh_check_app_version_changed

This commit is contained in:
kay0u 2019-05-09 10:41:49 +02:00
parent e9c5eee664
commit 7e2ba4785d

View file

@ -33,6 +33,12 @@ unicorn_worker_processes=$(ynh_app_setting_get --app="$app" --key=unicorn_worker
client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size)
overwrite_nginx=$(ynh_app_setting_get --app="$app" --key=overwrite_nginx)
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -202,7 +208,6 @@ chown admin: "$config_path/gitlab-persistent.rb"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=690
update_src_version() {
source ./upgrade.d/upgrade.last.sh
@ -217,19 +222,26 @@ update_src_version() {
fi
}
update_src_version
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Setting up source files..." --weight=690
tempdir="$(mktemp -d)"
update_src_version
ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
tempdir="$(mktemp -d)"
if IS_PACKAGE_CHECK; then
if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env
ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb"
ynh_exec_warn_less dpkg --configure gitlab-ce
ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
if IS_PACKAGE_CHECK; then
if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env
ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb"
ynh_exec_warn_less dpkg --configure gitlab-ce
fi
else
ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename
fi
else
ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename
ynh_exec_warn_less ynh_secure_remove --file="$tempdir"
fi
#=================================================