diff --git a/check_process b/check_process index 4bcbf8c..03f10cd 100644 --- a/check_process +++ b/check_process @@ -16,5 +16,6 @@ incorrect_path=0 port_already_use=0 change_url=0 -;;; Levels - Level 5=auto +;;; Options +Email= +Notification=none diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..aa8b092 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +GitLab Runner is a continuous integration tool to use with a GitLab instance (YNH or not). diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..3a39f6a --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +GitLab Runner est un outil d'intégration continue à utiliser avec une instance GitLab (YNH ou non). diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..4e53c7c --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1,12 @@ +## Configuration + +How to configure this app: by the admin panel of GitLab or the settings "CI/CD" of your project. + +### System configuration + +Running a Gitlab Runner mandates to choose [an executor](https://docs.gitlab.com/runner/executors/) at registeration time (when the Gitlab Runner instance registers to a Gitlab instance). For now this YunoHost application only supports the `docker` executor. + +## Additional information + +* To retrieve the information to be provided to the installation such as the `token` or the `gitlab's url` you must go here: `Settings->CI/CD->Runners->"Set up a specific Runner manually"` in the project or admin section of the GitLab instance to link to this runner. +* If you get this message during a job: `Could not resolve host: you.domain.tld`, you can add `dns_search = [“you.domain.tld”]` in the section `[[runners]]` section. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md new file mode 100644 index 0000000..e4e9f9d --- /dev/null +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,13 @@ +## Configuration + +Comment configurer cette application: via le panneau d'administration de GitLab ou les paramettres "CI/CD" de votre projet. + +### Configuration système + +Lors du premier démarrage d'un Gitlab Runner, [un exécuteur](https://docs.gitlab.com/runner/executors/) doit être choisi (Lorsque l'instance Gitlab Runner s'enregistre auprès d'une instance Gitlab). Pour l'instant, cette application YunoHost ne supporte que l'[exécuteur `docker`](https://docs.gitlab.com/runner/executors/docker.html). + +## Informations additionnelles + +* Pour récupérer les informations à fournir à l'installation comme le `token` ou `l'url gitlab` vous devez vous rendre ici : `Settings->CI/CD->Runners->"Set up a specific Runner manually"` dans le projet +ou la section admin de l'instance GitLab à relier à ce runner. +* Si vous avez ce message pendant un travail : `Could not resolve host : you.domain.tld`, vous pouvez ajouter `dns_search = ["you.domain.tld"]` dans la section `[[runners]]`. diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/screenshots/ci-cd-test-deploy-illustration_2x.png b/doc/screenshots/ci-cd-test-deploy-illustration_2x.png new file mode 100644 index 0000000..02c7a5f Binary files /dev/null and b/doc/screenshots/ci-cd-test-deploy-illustration_2x.png differ diff --git a/manifest.json b/manifest.json index a0fab20..b3bae84 100644 --- a/manifest.json +++ b/manifest.json @@ -6,21 +6,27 @@ "en": "Continuous integration tool to use with a GitLab instance (YNH or not).", "fr": "Outil d'intégration continue à utiliser avec une instance GitLab (YNH ou non)." }, - "version": "15.0.0~ynh1", + "version": "15.0.0~ynh2", "url": "https://gitlab.com/gitlab-org/gitlab-runner", + "upstream": { + "license": "MIT", + "website": "https://gitlab.com/gitlab-org/gitlab-runner", + "admindoc": "https://docs.gitlab.com/runner/", + "code": "https://gitlab.com/gitlab-org/gitlab-runner" + }, "license": "MIT", "maintainer": { "name": "kay0u", "email": "pierre@kayou.io" }, "requirements": { - "yunohost": ">= 4.2.3" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ ], "arguments": { - "install" : [ + "install": [ { "name": "gitlab_url", "type": "string", diff --git a/scripts/backup b/scripts/backup index 4fbff50..a3993da 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script @@ -24,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info "Loading installation settings..." +ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -38,4 +37,4 @@ app=$YNH_APP_INSTANCE_NAME # END OF SCRIPT #================================================= -ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index 100b98c..beb71b6 100755 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script @@ -82,18 +81,12 @@ ynh_app_setting_set --app=$app --key=config_path --value=$config_path #================================================= # STANDARD MODIFICATIONS -#================================================= -# ADD DOCKER REPO -#================================================= -ynh_script_progression --message="Adding a new repo..." - -ynh_install_extra_repo --repo="https://download.docker.com/linux/debian $(lsb_release -cs) stable" --key="https://download.docker.com/linux/debian/gpg" --name="${app}-docker" - #================================================= # INSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Installing dependencies..." +ynh_install_extra_repo --repo="https://download.docker.com/linux/debian $(lsb_release -cs) stable" --key="https://download.docker.com/linux/debian/gpg" --name="${app}-docker" ynh_install_app_dependencies $pkg_dependencies #================================================= @@ -165,8 +158,9 @@ ynh_store_file_checksum "$config_path/config.toml" #================================================= # GENERIC FINALIZATION #================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." yunohost service add $app @@ -174,4 +168,4 @@ yunohost service add $app # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 1aa0517..ae6771c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -21,13 +21,13 @@ config_path=$(ynh_app_setting_get --app=$app --key=config_path) #================================================= # STANDARD REMOVE #================================================= -# REMOVE SERVICE FROM ADMIN PANEL +# REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove a service from the admin panel, added by `yunohost service add` -if yunohost service status $app >/dev/null 2>&1 +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) +if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service" + ynh_script_progression --message="Removing $app service integration..." yunohost service remove $app fi @@ -48,27 +48,21 @@ dpkg --remove $app #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies" +ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies +ynh_remove_extra_repo --name="${app}-docker" #================================================= -# REMOVE APP CONFIG DIR +# REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing app config directory" +ynh_script_progression --message="Removing various files..." ynh_secure_remove --file="$config_path" -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing a repo..." - -ynh_remove_extra_repo --name="${app}-docker" - #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 4d21a24..dc2c594 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script @@ -24,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -41,22 +40,17 @@ docker_image=$(ynh_app_setting_get --app=$app --key=docker_image) ynh_script_progression --message="Validating restoration parameters..." test ! -d $config_path \ - || ynh_die "There is already a directory: $config_path " + || ynh_die --message="There is already a directory: $config_path " #================================================= # STANDARD RESTORATION STEPS #================================================= -# ADD DOCKER REPO -#================================================= -ynh_script_progression --message="Restoring the docker repo..." - -ynh_install_extra_repo --repo="https://download.docker.com/linux/debian $(lsb_release -cs) stable" --key="https://download.docker.com/linux/debian/gpg" --name="${app}-docker" - -#================================================= -# INSTALL DEPENDENCIES +# REINSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Reinstalling dependencies..." +# Define and install dependencies +ynh_install_extra_repo --repo="https://download.docker.com/linux/debian $(lsb_release -cs) stable" --key="https://download.docker.com/linux/debian/gpg" --name="${app}-docker" ynh_install_app_dependencies $pkg_dependencies #================================================= @@ -119,13 +113,21 @@ do done #================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# STORE THE CONFIG FILE CHECKSUM #================================================= +# Calculate and store the config file checksum into the app settings +ynh_store_file_checksum "$config_path/config.toml" + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + yunohost service add $app #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 4b83a54..020017a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,11 +19,11 @@ app=$YNH_APP_INSTANCE_NAME architecture=$(ynh_app_setting_get --app=$app --key=architecture) #================================================= -# ENSURE DOWNWARD COMPATIBILITY +# CHECK VERSION #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Checking version..." -# NOTING TO DO HERE YET +upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -33,7 +33,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -41,6 +41,13 @@ ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +# NOTING TO DO HERE YET + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -77,8 +84,9 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." yunohost service add $app @@ -86,4 +94,4 @@ yunohost service add $app # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of $app completed"