1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab-runner_ynh.git synced 2024-09-03 19:15:58 +02:00
This commit is contained in:
Éric Gaspar 2023-11-09 13:38:39 +01:00
parent 78f63c9a73
commit 87ca5cb7cc
13 changed files with 122 additions and 90 deletions

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_aarch64.deb
SOURCE_SUM=9747f0f82ec099ce34b1b352a9b09fbe237ed710f22c273fe7c08b1a80494b33
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=gitlab-runner.deb
SOURCE_EXTRACT=false

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_amd64.deb
SOURCE_SUM=7b619273ef5b845407dd45a84c7a1e07442493f2d140c94720f6c47c3a403b48
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=gitlab-runner.deb
SOURCE_EXTRACT=false

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_arm64.deb
SOURCE_SUM=de5287caceb49fc78757c41cf9e0b11f8817743c3f1fee94c02bbd60f1656e1a
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=gitlab-runner.deb
SOURCE_EXTRACT=false

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_armel.deb
SOURCE_SUM=8d78e75bf8b75b64d86aa5c05df47b0fc7941a7c953a2cf55a487d8c19ca1e10
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=gitlab-runner.deb
SOURCE_EXTRACT=false

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_armhf.deb
SOURCE_SUM=ff51a7962851c1447c20d4bacc5b3ef2eef038045f9849fde089b4225e67d1ba
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=gitlab-runner.deb
SOURCE_EXTRACT=false

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_i386.deb
SOURCE_SUM=271b0437223eba292a79b4c427bdbca3c5edd578292149526b2bec5eb27d8c57
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=deb
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=gitlab-runner.deb
SOURCE_EXTRACT=false

74
manifest.toml Normal file
View file

@ -0,0 +1,74 @@
packaging_format = 2
id = "gitlab-runner"
name = "GitLab Runner"
description.en = "Continuous integration tool to use with a GitLab instance (YNH or not)."
description.fr = "Outil d'intégration continue à utiliser avec une instance GitLab (YNH ou non)."
version = "16.5.0~ynh1"
maintainers = ["kay0u"]
[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"
cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)
fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin.
[integration]
yunohost = ">= 4.3.0"
architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"]
multi_instance = false
ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials.
sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal.
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
[install]
[install.gitlab_url]
ask.en = "Please enter the GitLab-CI coordinator URL"
ask.fr = "Veuillez entrer l'URL du coordinateur GitLab-CI"
help.en = "This URL can be retrieved at this location: GitLab Project->Settings->Runner or: Admin Area->Overview->Runners"
help.fr = "Cet URL peut être récupéré à cet emplacement : Projet GitLab->Settings->Runner ou : Admin Area->Overview->Runners"
type = "string"
example = "https://gitlab.com/"
[install.token]
ask.en = "Please enter the GitLab-CI token for this Runner"
ask.fr = "Veuillez entrer le jeton GitLab-CI pour ce Runner"
help.en = "This token can be retrieved at this location: GitLab Project->Settings->Runner or: Admin Area->Overview->Runners"
help.fr = "Ce token peut être récupéré à cet emplacement : Projet GitLab->Settings->Runner ou : Admin Area->Overview->Runners"
type = "string"
example = "xxx"
[install.docker_image]
ask.en = "Please enter the Docker image"
ask.fr = "Veuillez entrer l'image du Docker"
type = "string"
example = "ruby:2.1"
default = "alpine:latest"
[resources]
[resources.sources.main]
format = "deb"
rename = "gitlab-runner.deb"
arm64.url = "https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_aarch64.deb"
arm64.sha256 = "9747f0f82ec099ce34b1b352a9b09fbe237ed710f22c273fe7c08b1a80494b33"
amd64.url = "https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_amd64.deb"
amd64.sha256 = "7b619273ef5b845407dd45a84c7a1e07442493f2d140c94720f6c47c3a403b48"
armel.url = "https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_armel.deb"
armel.sha256 = "8d78e75bf8b75b64d86aa5c05df47b0fc7941a7c953a2cf55a487d8c19ca1e10"
armhf.url = "https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_armhf.deb"
armhf.sha256 = "ff51a7962851c1447c20d4bacc5b3ef2eef038045f9849fde089b4225e67d1ba"
i386.url = "https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v16.5.0/downloads/packages/deb/gitlab-runner_i386.deb"
i386.sha256 = "271b0437223eba292a79b4c427bdbca3c5edd578292149526b2bec5eb27d8c57"
[resources.system_user]
[resources.install_dir]
[resources.permissions]

View file

@ -5,7 +5,7 @@
#=================================================
# dependencies used by the app
pkg_dependencies="ca-certificates git curl tar docker-ce docker-ce-cli containerd.io"
#REMOVEME? pkg_dependencies="ca-certificates git curl tar docker-ce docker-ce-cli containerd.io"
#=================================================
# PERSONAL HELPERS
@ -15,10 +15,10 @@ pkg_dependencies="ca-certificates git curl tar docker-ce docker-ce-cli container
#
# usage:
# ynh_backup_before_action
# ynh_clean_setup () {
#REMOVEME? # ynh_clean_setup () {
# ynh_restore_actionbackup
# }
# ynh_abort_if_errors
#REMOVEME? # ynh_abort_if_errors
ynh_restore_actionbackup () {
echo "Action failed." >&2
local app_bck=${app//_/-} # Replace all '_' by '-'
@ -45,10 +45,10 @@ ynh_restore_actionbackup () {
#
# usage:
# ynh_backup_before_action
# ynh_clean_setup () {
#REMOVEME? # ynh_clean_setup () {
# ynh_restore_actionbackup
# }
# ynh_abort_if_errors
#REMOVEME? # ynh_abort_if_errors
ynh_backup_before_action () {
if [ ! -e "/etc/yunohost/apps/$app/scripts/backup" ]
then

View file

@ -14,18 +14,18 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
#REMOVEME? ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#=================================================
# STANDARD BACKUP STEPS

View file

@ -13,26 +13,26 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
gitlab_url=$YNH_APP_ARG_GITLAB_URL
token=$YNH_APP_ARG_TOKEN
docker_image=$YNH_APP_ARG_DOCKER_IMAGE
#REMOVEME? gitlab_url=$YNH_APP_ARG_GITLAB_URL
#REMOVEME? token=$YNH_APP_ARG_TOKEN
#REMOVEME? docker_image=$YNH_APP_ARG_DOCKER_IMAGE
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..."
#REMOVEME? ynh_script_progression --message="Validating installation parameters..."
config_path=/etc/$app
test ! -e "$config_path" || ynh_die "This path already contains a folder"
@ -58,23 +58,23 @@ fi
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..."
#REMOVEME? ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=gitlab_url --value=$gitlab_url
ynh_app_setting_set --app=$app --key=token --value=$token
ynh_app_setting_set --app=$app --key=executor --value=$executor
ynh_app_setting_set --app=$app --key=docker_image --value=$docker_image
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
#REMOVEME? ynh_app_setting_set --app=$app --key=config_path --value=$config_path
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..."
#REMOVEME? 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
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -12,11 +12,11 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#REMOVEME? config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# STANDARD REMOVE
@ -48,10 +48,10 @@ dpkg --remove $app
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
#REMOVEME? ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#REMOVEME? ynh_remove_app_dependencies
ynh_remove_extra_repo --name="${app}-docker"
#=================================================

View file

@ -14,30 +14,30 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
architecture=$(ynh_app_setting_get --app=$app --key=architecture)
gitlab_url=$(ynh_app_setting_get --app=$app --key=gitlab_url)
token=$(ynh_app_setting_get --app=$app --key=token)
executor=$(ynh_app_setting_get --app=$app --key=executor)
docker_image=$(ynh_app_setting_get --app=$app --key=docker_image)
#REMOVEME? config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#REMOVEME? architecture=$(ynh_app_setting_get --app=$app --key=architecture)
#REMOVEME? gitlab_url=$(ynh_app_setting_get --app=$app --key=gitlab_url)
#REMOVEME? token=$(ynh_app_setting_get --app=$app --key=token)
#REMOVEME? executor=$(ynh_app_setting_get --app=$app --key=executor)
#REMOVEME? docker_image=$(ynh_app_setting_get --app=$app --key=docker_image)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
#REMOVEME? ynh_script_progression --message="Validating restoration parameters..."
test ! -d $config_path \
|| ynh_die --message="There is already a directory: $config_path "
@ -47,11 +47,11 @@ test ! -d $config_path \
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
#REMOVEME? 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
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -12,11 +12,11 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
architecture=$(ynh_app_setting_get --app=$app --key=architecture)
#REMOVEME? architecture=$(ynh_app_setting_get --app=$app --key=architecture)
#=================================================
# CHECK VERSION
@ -28,16 +28,16 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
#REMOVEME? ynh_backup_before_upgrade
#REMOVEME? ynh_clean_setup () {
# Restore it if the upgrade fails
ynh_restore_upgradebackup
#REMOVEME? ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
@ -65,10 +65,10 @@ fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..."
#REMOVEME? ynh_script_progression --message="Upgrading 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
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
#=================================================
# INTEGRATE SERVICE IN YUNOHOST