From 74c24d929c527947389983dacabe3c8314ed14ca Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 4 Apr 2024 13:51:02 +0200 Subject: [PATCH] fix https://github.com/YunoHost-Apps/gitlab-runner_ynh/issues/104, start the docker service if it's not active --- scripts/install | 5 +++++ scripts/upgrade | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/scripts/install b/scripts/install index 3bd7854..42496f9 100755 --- a/scripts/install +++ b/scripts/install @@ -46,6 +46,11 @@ ynh_app_setting_set --app=$app --key=executor --value=$executor #================================================= ynh_script_progression --message="Setting up source files..." +# Make sure docker is running before installing gitlab-runner +if ! systemctl is-active --quiet docker; then + ynh_systemd_action --service_name=docker --action=restart --line_match="API listen on /run/docker.sock" +fi + tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir dpkg -i $tempdir/gitlab-runner.deb diff --git a/scripts/upgrade b/scripts/upgrade index 9cb9f94..eb7a6c9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,6 +32,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 + # Make sure docker is running before installing gitlab-runner + if ! systemctl is-active --quiet docker; then + ynh_systemd_action --service_name=docker --action=restart --line_match="API listen on /run/docker.sock" + fi + tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir dpkg -i $tempdir/gitlab-runner.deb