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

Better error handling

This commit is contained in:
Pierre Bourré 2019-03-17 20:14:06 +01:00
parent 4cd3ec5360
commit 73c0dab80e
3 changed files with 6 additions and 3 deletions

View file

@ -140,9 +140,10 @@ tempdir="$(mktemp -d)"
ynh_setup_source $tempdir $architecture
if IS_PACKAGE_CHECK; then
dpkg -i $tempdir/$gitlab_filename || true # This command will fail in lxc env
if [ ! dpkg -i $tempdir/$gitlab_filename ]; then # This command will fail in lxc env
ynh_replace_string "command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" "command \"cat \/etc\/sysctl.conf\"" "$final_path/embedded/cookbooks/package/resources/sysctl.rb"
dpkg --configure gitlab-ce
fi
else
dpkg -i $tempdir/$gitlab_filename
fi

View file

@ -95,9 +95,10 @@ tempdir="$(mktemp -d)"
ynh_setup_source $tempdir $architecture
if IS_PACKAGE_CHECK; then
dpkg -i $tempdir/$gitlab_filename || true # This command will fail in lxc env
if [ ! dpkg -i $tempdir/$gitlab_filename ]; then # This command will fail in lxc env
ynh_replace_string "command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" "command \"cat \/etc\/sysctl.conf\"" "$final_path/embedded/cookbooks/package/resources/sysctl.rb"
dpkg --configure gitlab-ce
fi
else
dpkg -i $tempdir/$gitlab_filename
fi

View file

@ -179,9 +179,10 @@ tempdir="$(mktemp -d)"
ynh_setup_source $tempdir $architecture
if IS_PACKAGE_CHECK; then
dpkg -i $tempdir/$gitlab_filename || true # This command will fail in lxc env
if [ ! dpkg -i $tempdir/$gitlab_filename ]; then # This command will fail in lxc env
ynh_replace_string "command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" "command \"cat \/etc\/sysctl.conf\"" "$final_path/embedded/cookbooks/package/resources/sysctl.rb"
dpkg --configure gitlab-ce
fi
else
dpkg -i $tempdir/$gitlab_filename
fi