From 12516ba0b4dc3862148593995c8202f6dac04120 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:20:04 +0100 Subject: [PATCH 01/32] Apply example_ynh on manifest + upgrade version number --- manifest.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index c5f99b4..651f081 100644 --- a/manifest.json +++ b/manifest.json @@ -3,9 +3,10 @@ "id": "yunorunner", "packaging_format": 1, "description": { - "en": "CI runner for YunoHost" + "en": "Continuous integration runner for YunoHost", + "fr": "Runner d'intégration continue pour YunoHost." }, - "version": "010219~ynh1", + "version": "010219~ynh2", "url": "https://github.com/YunoHost/yunorunner", "license": "free", "maintainer": { @@ -28,7 +29,7 @@ "en": "Choose a domain for YunoRunner", "fr": "Choisissez un domaine pour YunoRunner" }, - "example": "domain.org" + "example": "example.com" }, { "name": "path", From 065a277d5b9a62a38992893e4a859102831d812c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:32:04 +0100 Subject: [PATCH 02/32] Apply example_ynh on install --- scripts/install | 54 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index cd865c3..575ef99 100644 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,15 +10,15 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# MANAGE FAILURE OF THE SCRIPT +# MANAGE SCRIPT FAILURE #================================================= -# ynh_clean_setup () { -# Nettoyage des rĂ©sidus d'installation non pris en charge par le script remove. -# Pas de nettoyage supplĂ©mentaire nĂ©cessaire ici... -# echo "" -# } -ynh_abort_if_errors # Active trap pour arrĂŞter le script si une erreur est dĂ©tectĂ©e. +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 +ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST @@ -32,6 +32,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= +ynh_print_info "Validating installation parameters..." final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" @@ -39,14 +40,13 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" # Normalize the url path syntax path_url=$(ynh_normalize_url_path $path_url) -# Check web path availability -ynh_webpath_available $domain $path_url # Register (book) web path ynh_webpath_register $app $domain $path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= +ynh_print_info "Storing installation settings..." ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path_url @@ -56,36 +56,46 @@ ynh_app_setting_set $app path $path_url #================================================= # FIND AND OPEN A PORT #================================================= +ynh_print_info "Configuring firewall..." +# Find a free port port=$(ynh_find_port 4242) -# Ouvre le port dans le firewall -ynh_exec_fully_quiet yunohost firewall allow --no-upnp TCP $port +# Open this port +ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_app_setting_set $app port $port #================================================= # INSTALL DEPENDENCIES #================================================= +ynh_print_info "Installing dependencies..." ynh_install_app_dependencies python-virtualenv sqlite3 libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_print_info "Setting up source files..." ynh_app_setting_set $app final_path $final_path -ynh_setup_source "$final_path" # TĂ©lĂ©charge la source, dĂ©compresse et copie dans $final_path +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source "$final_path" #================================================= # NGINX CONFIGURATION #================================================= +ynh_print_info "Configuring nginx..." +# Create a dedicated nginx config ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= +ynh_print_info "Configuring system user..." + +# Create a system user +ynh_system_user_create $app -ynh_system_user_create $app # CrĂ©er un utilisateur système dĂ©diĂ© Ă  l'app #================================================= # SPECIFIC SETUP @@ -120,7 +130,9 @@ ve3/bin/pip3 install -r requirements.txt ) #================================================= # SETUP SYSTEMD #================================================= +ynh_print_info "Configuring a systemd service..." +# Create a dedicated systemd config ynh_add_systemd_config #================================================= @@ -128,6 +140,7 @@ ynh_add_systemd_config #================================================= ynh_replace_string "__PORT__" "$port" "/etc/systemd/system/$app.service" +# Calculate and store the config file checksum into the app settings ynh_store_file_checksum "/etc/systemd/system/$app.service" systemctl daemon-reload @@ -137,17 +150,19 @@ systemctl daemon-reload # SECURING FILES AND DIRECTORIES #================================================= +# Set permissions to app files chown -R $app:root $final_path #================================================= # ENABLE SERVICE IN ADMIN PANEL #================================================= -yunohost service add $app.service +yunohost service add $app --description "$app daemon for YunoRunner" #================================================= # SETUP SSOWAT #================================================= +ynh_script_progression --message="Configuring SSOwat..." # Make app public ynh_app_setting_set $app skipped_uris "/" @@ -155,11 +170,18 @@ ynh_app_setting_set $app skipped_uris "/" #================================================= # RELOAD NGINX #================================================= +ynh_print_info "Reloading nginx..." -ynh_system_reload --service_name=nginx +systemctl reload nginx #================================================= # START YUNORUNNER #================================================= ynh_system_reload --service_name=$app --action=start + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Installation of $app completed" From 942f0155c99c73dc6fe49cedd41234f50a462b1b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:33:19 +0100 Subject: [PATCH 03/32] Apply example_ynh to backup --- scripts/backup | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index 1aa2bc1..dd33ed9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -19,6 +19,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= +ynh_print_info "Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -28,14 +29,16 @@ domain=$(ynh_app_setting_get $app domain) #================================================= # STANDARD BACKUP STEPS #================================================= -# BACKUP OF THE MAIN DIR OF THE APP +# BACKUP THE APP MAIN DIR #================================================= +ynh_print_info "Backing up the main app directory..." ynh_backup "$final_path" #================================================= -# BACKUP OF THE NGINX CONFIGURATION +# BACKUP THE NGINX CONFIGURATION #================================================= +ynh_print_info "Backing up nginx configuration..." ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" @@ -44,6 +47,12 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP SYSTEMD #================================================= +ynh_print_info "Backing up systemd configuration..." ynh_backup "/etc/systemd/system/$app.service" +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." From 499a52b1e0334e151141eea632e9bf4c2142e64f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:37:43 +0100 Subject: [PATCH 04/32] apply example_ynh on restore --- scripts/restore | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/scripts/restore b/scripts/restore index 388aad6..b52ca8b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= +ynh_print_info "Loading settings..." app=$YNH_APP_INSTANCE_NAME @@ -29,6 +30,7 @@ final_path=$(ynh_app_setting_get $app final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= +ynh_print_info "Validating restoration parameters..." ynh_webpath_available $domain $path_url \ || ynh_die "Path not available: ${domain}${path_url}" @@ -42,29 +44,33 @@ test ! -d $final_path \ ynh_maintenance_mode_ON #================================================= -# STANDARD RESTORE STEPS +# STANDARD RESTORATION STEPS #================================================= -# RESTORE OF THE NGINX CONFIGURATION +# RESTORE THE NGINX CONFIGURATION #================================================= ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= -# RESTORE OF THE MAIN DIR OF THE APP +# RESTORE THE APP MAIN DIR #================================================= +ynh_print_info "Restore the app main directory..." ynh_restore_file "$final_path" #================================================= -# RECREATE OF THE DEDICATED USER +# RECREATE THE DEDICATED USER #================================================= +ynh_print_info "Recreate the dedicated systen user..." -ynh_system_user_create $app # Recreate the dedicated user, if not exist +# Create the dedicated user (if not existing) +ynh_system_user_create $app #================================================= # RESTORE USER RIGHTS #================================================= +# Restore permissions on app files chown -R $app:root $final_path #================================================= @@ -72,28 +78,32 @@ chown -R $app:root $final_path #================================================= # REINSTALL DEPENDENCIES #================================================= +ynh_print_info "Reinstall dependencies..." +# Define and install dependencies ynh_install_app_dependencies python-virtualenv sqlite3 zlib1g-dev -#================================================= -# ENABLE SERVICE IN ADMIN PANEL -#================================================= - -yunohost service add $app.service #================================================= # RESTORE SYSTEMD #================================================= +ynh_print_info "Restoring the systemd configuration..." ynh_restore_file "/etc/systemd/system/$app.service" -## DĂ©marrage auto du service systemctl enable $app.service #================================================= -# GENERIC FINALISATION +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +yunohost service add $app --description "$app daemon for YunoRunner" + +#================================================= +# GENERIC FINALIZATION #================================================= # RELOAD NGINX #================================================= +ynh_print_info "Reloading nginx" ynh_system_reload --service_name=nginx @@ -108,3 +118,9 @@ ynh_system_reload --service_name=$app --action=start #================================================= ynh_maintenance_mode_OFF + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Restoration completed for $app" From 427b54c949db47dca773a2d08ae3695d46ef3650 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:40:31 +0100 Subject: [PATCH 05/32] Apply example_ynh to remove --- scripts/remove | 52 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/scripts/remove b/scripts/remove index 632eb44..87b542b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= +ynh_print_info "Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -20,39 +21,48 @@ port=$(ynh_app_setting_get $app port) #================================================= # STANDARD REMOVE +#================================================= +# REMOVE SERVICE FROM ADMIN PANEL +#================================================= + +# Remove a service from the admin panel, added by `yunohost service add` +if yunohost service status | grep -q $app +then + ynh_print_info "Removing $app service" + yunohost service remove $app +fi + #================================================= # STOP AND REMOVE SERVICE #================================================= +ynh_print_info "Stopping and removing the service" +# Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# DISABLE SERVICE IN ADMIN PANEL -#================================================= - -if yunohost service status | grep -q $app # Test l'existence du service dans Yunohost -then - ynh_print_info "Remove $app service" >&2 - yunohost service remove $app.service -fi - #================================================= # REMOVE DEPENDENCIES #================================================= +ynh_print_info "Removing dependencies" +# Remove metapackage and its dependencies ynh_remove_app_dependencies #================================================= -# REMOVE THE MAIN DIR OF THE APP +# REMOVE APP MAIN DIR #================================================= +ynh_print_info "Removing app main directory" -ynh_secure_remove "/var/www/$app" # Suppression du dossier de l'application +# Remove the app directory securely +ynh_secure_remove "$final_path" #================================================= -# REMOVE THE NGINX CONFIGURATION +# REMOVE NGINX CONFIGURATION #================================================= +ynh_print_info "Removing nginx configuration" -ynh_remove_nginx_config # Suppression de la configuration nginx +# Remove the dedicated nginx config +ynh_remove_nginx_config #================================================= # CLOSE A PORT @@ -60,8 +70,8 @@ ynh_remove_nginx_config # Suppression de la configuration nginx if yunohost firewall list | grep -q "\- $port$" then - ynh_print_info "Close port $port" >&2 - ynh_exec_quiet yunohost firewall disallow TCP $port + ynh_print_info "Closing port $port" + ynh_exec_warn_less yunohost firewall disallow TCP $port fi #================================================= @@ -69,5 +79,13 @@ fi #================================================= # REMOVE DEDICATED USER #================================================= +ynh_print_info "Removing the dedicated system user" +# Delete a system user ynh_system_user_delete $app + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Removal of $app completed" From cd9e0d02d2bee0b483079d74bb58fc02a43e4cf6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:46:11 +0100 Subject: [PATCH 06/32] Apply example_ynh to upgrade --- scripts/upgrade | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e2ec6d3..8908f70 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,7 @@ #!/bin/bash #================================================= -# GENERIC STARTING +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= +ynh_print_info "Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -29,6 +30,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= +ynh_print_info "Ensuring downward compatibility..." # If port doesn't exist, create it if [ -z "$port" ]; then @@ -39,6 +41,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= +ynh_print_info "Backing up the app before upgrading... (may take a while)" # Backup the current version of the app ynh_backup_before_upgrade @@ -53,7 +56,8 @@ ynh_abort_if_errors # CHECK THE PATH #================================================= -path_url=$(ynh_normalize_url_path $path_url) # VĂ©rifie et corrige la syntaxe du path. +# Normalize the URL path syntax +path_url=$(ynh_normalize_url_path $path_url) #================================================= # ACTIVATE MAINTENANCE MODE @@ -66,29 +70,38 @@ ynh_maintenance_mode_ON #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_print_info "Upgrading source files..." if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_setup_source "$final_path" # TĂ©lĂ©charge la source, dĂ©compresse et copie dans $final_path + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source "$final_path" fi -#================================================= -# UPGRADE DEPENDENCIES -#================================================= - -ynh_install_app_dependencies python-virtualenv sqlite3 zlib1g-dev - #================================================= # NGINX CONFIGURATION #================================================= +ynh_print_info "Upgrading nginx configuration..." +# Create a dedicated nginx config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_print_info "Upgrading dependencies..." + +ynh_install_app_dependencies python-virtualenv sqlite3 zlib1g-dev + + #================================================= # CREATE DEDICATED USER #================================================= +ynh_print_info "Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create $app -ynh_system_user_create $app # Create the dedicated user, if not exist #================================================= # SPECIFIC UPGRADE @@ -108,17 +121,18 @@ ynh_store_file_checksum "/etc/systemd/system/$app.service" systemctl daemon-reload #================================================= -# GENERIC FINALISATION +# GENERIC FINALIZATION #================================================= -#================================================= -# SECURING FILES AND DIRECTORIES +# SECURE FILES AND DIRECTORIES #================================================= +# Set permissions on app files chown -R $app:root $final_path #================================================= # SETUP SSOWAT #================================================= +ynh_print_info "Upgrading SSOwat configuration..." # Make app public ynh_app_setting_set $app skipped_uris "/" @@ -126,6 +140,7 @@ ynh_app_setting_set $app skipped_uris "/" #================================================= # RELOAD NGINX #================================================= +ynh_print_info "Reloading nginx..." ynh_system_reload --service_name=nginx @@ -141,3 +156,9 @@ ynh_system_reload --service_name=$app --action=restart #================================================= ynh_maintenance_mode_OFF + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Upgrade of $app completed" From 9c558f3cbcf1eb047b9ecb0615d550880eb97c8c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:48:51 +0100 Subject: [PATCH 07/32] apply example_ynh to change_url --- scripts/change_url | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 2b77032..41cd000 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,6 +24,10 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= +ynh_print_info "Loading installation settings..." + +# Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get $app final_path) port=$(ynh_app_setting_get $app port) @@ -72,6 +76,7 @@ ynh_abort_if_errors #================================================= # MODIFY URL IN NGINX CONF #================================================= +ynh_print_info "Updating nginx configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -108,6 +113,7 @@ fi #================================================= # RELOAD NGINX #================================================= +ynh_print_info "Reloading nginx..." ynh_system_reload --service_name=nginx @@ -118,3 +124,9 @@ ynh_system_reload --service_name=nginx path_url=$old_path domain=$old_domain ynh_maintenance_mode_OFF + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info "Change of url completed for $app" From ee699222169e45903582c29471ffd65c68b5078a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:55:14 +0100 Subject: [PATCH 08/32] apply example_ynh to README.md --- README.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d3ad7e0..eed8a0a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # YunoRunner for YunoHost -[![Integration level](https://dash.yunohost.org/integration/APP.svg)](https://dash.yunohost.org/appci/app/yunorunner) -[![Install YunoRunner with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=yunorunner) +[![Integration level](https://dash.yunohost.org/integration/yunorunner.svg)](https://dash.yunohost.org/appci/app/yunorunner) +[![Install yunorunner with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=yunorunner) > *This package allow you to install YunoRunner quickly and simply on a YunoHost server. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* @@ -13,9 +13,9 @@ YunoRunner is our own CI runner for YunoHost Apps #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/APP%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/yunorunner%20(Community)/) -* ARMv8-A - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/APP%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/yunorunner%20(Community)%20(%7EARM%7E)/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/jenkins/job/leed%20(Community)/badge/icon)](https://ci-stretch.nohost.me/jenkins/job/yunorunner%20(Community)/) +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/yunorunner%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/yunorunner/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/yunorunner%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/yunorunner/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/yunorunner%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/yunorunner/) ## Limitations @@ -23,5 +23,21 @@ YunoRunner is our own CI runner for YunoHost Apps ## Links - * Report a bug: https://github.com/YunoHost-Apps/yunorunner_ynh/issues + * Report a bug: https://github.com/YunoHost-Apps/yunorunner_ynh_core/issues + * App website: Link to the official website of this app * YunoHost website: https://yunohost.org/ + +--- + +Developers info +---------------- + +**Only if you want to use a testing branch for coding, instead of merging directly into master.** +Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/yunorunner_ynh_core/tree/testing). + +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/yunorunner_ynh_core/issues/tree/testing --debug +or +sudo yunohost app upgrade yunorunner -u https://github.com/YunoHost-Apps/yunorunner_ynh_core/tree/testing --debug +``` From daa63f5d43ea730ba680d209ff71c13dfc0143c5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 19:59:45 +0100 Subject: [PATCH 09/32] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eed8a0a..b197b40 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,16 @@ YunoRunner is our own CI runner for YunoHost Apps **Shipped version:** Work in progress... +## Screenshots + +![](https://user-images.githubusercontent.com/30271971/52810447-e06b5600-3092-11e9-9853-fb46e46fda65.PNG) + +## Demo + +* [Official demo](https://ci-apps.yunohost.org) + + + #### Supported architectures * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/yunorunner%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/yunorunner/) @@ -24,7 +34,7 @@ YunoRunner is our own CI runner for YunoHost Apps ## Links * Report a bug: https://github.com/YunoHost-Apps/yunorunner_ynh_core/issues - * App website: Link to the official website of this app + * App website: https://github.com/YunoHost/yunorunner * YunoHost website: https://yunohost.org/ --- From 353f6a524a55afbb10d5d55b4e5ab47d6339c8f4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:00:49 +0100 Subject: [PATCH 10/32] README.md update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b197b40..540d714 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ YunoRunner is our own CI runner for YunoHost Apps * [Official demo](https://ci-apps.yunohost.org) - +## YunoHost specific features #### Supported architectures From 108ebb1e0f627e50b9344fae7ba29cf982f26333 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:04:51 +0100 Subject: [PATCH 11/32] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 540d714..6b304c4 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ YunoRunner is our own CI runner for YunoHost Apps ## Limitations -* You need to install [CI_package_check](https://github.com/YunoHost/CI_package_check) before YunoRunner and modify the systemd script to add the path of the script analyseCI.sh. +* You need to install [CI_package_check](https://github.com/YunoHost/CI_package_check) using the build_CI.sh script before installing YunoRunner +* When YunoRunner is installed, modify the systemd script to add the path of the script analyseCI.sh. The default systemd is configured to /home/CI_package_check/analyseCI.sh ## Links From 593510b5915306cff8e44af7ed1f70c0809aacb9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:12:22 +0100 Subject: [PATCH 12/32] Fixe current upstream application websocket version error --- scripts/install | 10 +++++++--- scripts/upgrade | 9 +++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 575ef99..cfbd3a0 100644 --- a/scripts/install +++ b/scripts/install @@ -123,9 +123,13 @@ $final_path/.pythonz/bin/pythonz install 3.6.6 # INSTALL YUNORUNNER DEPENDENCIES #================================================= -( cd $final_path -virtualenv -p $($final_path/.pythonz/bin/pythonz locate 3.6.6) ve3 -ve3/bin/pip3 install -r requirements.txt ) +pushd $final_path + virtualenv -p $($final_path/.pythonz/bin/pythonz locate 3.6.6) ve3 + ve3/bin/pip3 install -r requirements.txt + #Fix current websocket version error (2019-02-14) + ve3/bin/pip3 uninstall websockets + ve3/bin/pip3 install 'websockets>=6.0,<7.0' +popd #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 8908f70..8df02ad 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,6 +120,15 @@ ynh_replace_string "__PORT__" "$port" "/etc/systemd/system/$app.service" ynh_store_file_checksum "/etc/systemd/system/$app.service" systemctl daemon-reload +#================================================= +# Fix current websocket version error (2019-02-14) +#================================================= + +pushd $final_path + ve3/bin/pip3 uninstall websockets + ve3/bin/pip3 install 'websockets>=6.0,<7.0' +popd + #================================================= # GENERIC FINALIZATION #================================================= From 479a6c02d428b7ca4d961cb1a6419c95dfdab87e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:14:52 +0100 Subject: [PATCH 13/32] remove systemctl references as in master --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index cfbd3a0..f10f800 100644 --- a/scripts/install +++ b/scripts/install @@ -176,7 +176,7 @@ ynh_app_setting_set $app skipped_uris "/" #================================================= ynh_print_info "Reloading nginx..." -systemctl reload nginx +ynh_system_reload --service_name=nginx #================================================= # START YUNORUNNER From 38e1fc106dc517e04b8cf70f85d5754a8bab4996 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:21:06 +0100 Subject: [PATCH 14/32] Close not needed port --- scripts/install | 2 +- scripts/upgrade | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f10f800..7314611 100644 --- a/scripts/install +++ b/scripts/install @@ -61,7 +61,7 @@ ynh_print_info "Configuring firewall..." # Find a free port port=$(ynh_find_port 4242) # Open this port -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port +#ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_app_setting_set $app port $port #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8df02ad..355b760 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,6 +38,16 @@ if [ -z "$port" ]; then ynh_app_setting_set $app port $port fi +#================================================= +# CLOSE A PORT +#================================================= + +if yunohost firewall list | grep -q "\- $port$" +then + ynh_print_info "Closing port $port" + ynh_exec_warn_less yunohost firewall disallow TCP $port +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From b01fecec83ec544b21501da040faf28261a29ee1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:25:43 +0100 Subject: [PATCH 15/32] fix manifest.json spacing --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 651f081..009d68f 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "Continuous integration runner for YunoHost", - "fr": "Runner d'intégration continue pour YunoHost." + "fr": "Runner d'intégration continue pour YunoHost." }, "version": "010219~ynh2", "url": "https://github.com/YunoHost/yunorunner", From 72dec366d95f7a0c730fc76acc6b99a7f22bb927 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:27:31 +0100 Subject: [PATCH 16/32] remove comma --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 009d68f..62b29d8 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "Continuous integration runner for YunoHost", - "fr": "Runner d'intégration continue pour YunoHost." + "fr": "Runner intégration continue pour YunoHost." }, "version": "010219~ynh2", "url": "https://github.com/YunoHost/yunorunner", From cd17a164140c930f022712b258d4d36049d72ed3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:29:49 +0100 Subject: [PATCH 17/32] fix spacing --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 62b29d8..465b222 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,7 @@ "en": "Choose a domain for YunoRunner", "fr": "Choisissez un domaine pour YunoRunner" }, - "example": "example.com" + "example": "example.com" }, { "name": "path", From 4495fb05f651fa22ce5c28640ecbadc3ea70e0f9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:35:09 +0100 Subject: [PATCH 18/32] back to original manifest.json --- manifest.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 465b222..c5f99b4 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,9 @@ "id": "yunorunner", "packaging_format": 1, "description": { - "en": "Continuous integration runner for YunoHost", - "fr": "Runner intégration continue pour YunoHost." + "en": "CI runner for YunoHost" }, - "version": "010219~ynh2", + "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", "license": "free", "maintainer": { @@ -29,7 +28,7 @@ "en": "Choose a domain for YunoRunner", "fr": "Choisissez un domaine pour YunoRunner" }, - "example": "example.com" + "example": "domain.org" }, { "name": "path", From fb08c5204913d49f68b8607b98c13c5f9b6423ca Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:36:20 +0100 Subject: [PATCH 19/32] Adding french description --- manifest.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index c5f99b4..9527ee6 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,8 @@ "id": "yunorunner", "packaging_format": 1, "description": { - "en": "CI runner for YunoHost" + "en": "CI runner for YunoHost", + "fr": "Exemple de package d’application pour YunoHost." }, "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", From ebe49b7b8fb9b7625a0dafa9efa23ec5f935e2cd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:37:01 +0100 Subject: [PATCH 20/32] remove comma --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 9527ee6..4ef4cc0 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "CI runner for YunoHost", - "fr": "Exemple de package d’application pour YunoHost." + "fr": "Exemple de package dapplication pour YunoHost." }, "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", From ef6e6ced6a1ecb3813f0e23e1df1fd34ff6b531a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:37:45 +0100 Subject: [PATCH 21/32] remove french translation --- manifest.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 4ef4cc0..c5f99b4 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,7 @@ "id": "yunorunner", "packaging_format": 1, "description": { - "en": "CI runner for YunoHost", - "fr": "Exemple de package dapplication pour YunoHost." + "en": "CI runner for YunoHost" }, "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", From c994de9f3996e6a33443712ad4ecfd97a97c468f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:38:22 +0100 Subject: [PATCH 22/32] adding translation --- manifest.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index c5f99b4..2c92abf 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,8 @@ "id": "yunorunner", "packaging_format": 1, "description": { - "en": "CI runner for YunoHost" + "en": "CI runner for YunoHost", + "fr": "CI runner for YunoHost" }, "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", From a6b07516125b2ad57d7170b20e23e283cd2740a8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:39:20 +0100 Subject: [PATCH 23/32] french translation of the description --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 2c92abf..b783cda 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "CI runner for YunoHost", - "fr": "CI runner for YunoHost" + "fr": "Runner intégration continue pour YunoHost" }, "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", From c3cb8761b84bdcbaf324d4b5fe6d9bd48a093230 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:40:50 +0100 Subject: [PATCH 24/32] fix UTF8 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index b783cda..8b82fc6 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "CI runner for YunoHost", - "fr": "Runner intégration continue pour YunoHost" + "fr": "Runner intĂ©gration continue pour YunoHost" }, "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", From bedc48d437b4bbdd61efc4e1b0245b907e79cdcc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:41:56 +0100 Subject: [PATCH 25/32] switch to default example.com --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 8b82fc6..956a3b0 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "packaging_format": 1, "description": { "en": "CI runner for YunoHost", - "fr": "Runner intĂ©gration continue pour YunoHost" + "fr": "Runner d'intĂ©gration continue pour YunoHost" }, "version": "010219~ynh1", "url": "https://github.com/YunoHost/yunorunner", @@ -29,7 +29,7 @@ "en": "Choose a domain for YunoRunner", "fr": "Choisissez un domaine pour YunoRunner" }, - "example": "domain.org" + "example": "example.com" }, { "name": "path", From 56df8213ab8db70de2256081f604b4dac815d997 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:49:01 +0100 Subject: [PATCH 26/32] fix websocket uninstall --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 7314611..3045735 100644 --- a/scripts/install +++ b/scripts/install @@ -127,7 +127,7 @@ pushd $final_path virtualenv -p $($final_path/.pythonz/bin/pythonz locate 3.6.6) ve3 ve3/bin/pip3 install -r requirements.txt #Fix current websocket version error (2019-02-14) - ve3/bin/pip3 uninstall websockets + ve3/bin/pip3 -y uninstall websockets ve3/bin/pip3 install 'websockets>=6.0,<7.0' popd diff --git a/scripts/upgrade b/scripts/upgrade index 355b760..3e70daf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -135,7 +135,7 @@ systemctl daemon-reload #================================================= pushd $final_path - ve3/bin/pip3 uninstall websockets + ve3/bin/pip3 -y uninstall websockets ve3/bin/pip3 install 'websockets>=6.0,<7.0' popd From ce2ac28d0a446df958b1f8ab876233cf4d102da0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:50:35 +0100 Subject: [PATCH 27/32] fix ynh_script_progression not existing --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 3045735..fc7108d 100644 --- a/scripts/install +++ b/scripts/install @@ -166,7 +166,7 @@ yunohost service add $app --description "$app daemon for YunoRunner" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_print_info "Configuring SSOwat..." # Make app public ynh_app_setting_set $app skipped_uris "/" From 4ec77c8cb9bf7d5d96a5cbd08a40fc14d79c4ee5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 20:57:25 +0100 Subject: [PATCH 28/32] fix websocket uninstall --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index fc7108d..7e1f93f 100644 --- a/scripts/install +++ b/scripts/install @@ -127,7 +127,7 @@ pushd $final_path virtualenv -p $($final_path/.pythonz/bin/pythonz locate 3.6.6) ve3 ve3/bin/pip3 install -r requirements.txt #Fix current websocket version error (2019-02-14) - ve3/bin/pip3 -y uninstall websockets + ve3/bin/pip3 uninstall -y websockets ve3/bin/pip3 install 'websockets>=6.0,<7.0' popd diff --git a/scripts/upgrade b/scripts/upgrade index 3e70daf..d5bb1ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -135,7 +135,7 @@ systemctl daemon-reload #================================================= pushd $final_path - ve3/bin/pip3 -y uninstall websockets + ve3/bin/pip3 uninstall -y websockets ve3/bin/pip3 install 'websockets>=6.0,<7.0' popd From 2283b11a708be3fd720e9a54a9008c52577295b5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 21:27:21 +0100 Subject: [PATCH 29/32] Adding remove step to remove python and dependencies --- scripts/remove | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/remove b/scripts/remove index 87b542b..0f4df60 100755 --- a/scripts/remove +++ b/scripts/remove @@ -40,6 +40,22 @@ ynh_print_info "Stopping and removing the service" # Remove the dedicated systemd config ynh_remove_systemd_config +#================================================= +# REMOVE YUNORUNNER DEPENDENCIES +#================================================= + +pushd $final_path + ve3/bin/pip3 uninstall -y -r requirements.txt +popd +/var/www/yunorunner/.pythonz/bin/pythonz install 3.6.6 + +#================================================= +# REMOVE PYTHON 3.6 AND PYTHONZ +#================================================= + +$final_path/.pythonz/bin/pythonz uninstall 3.6.6 +$final_path/.pythonz/bin/pythonz cleanup + #================================================= # REMOVE DEPENDENCIES #================================================= From bba73d92fa1895cf0cd8f279909c58040ff5dcd7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 21:32:47 +0100 Subject: [PATCH 30/32] adding $final_path missing --- scripts/remove | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/remove b/scripts/remove index 0f4df60..b054f15 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) port=$(ynh_app_setting_get $app port) +final_path=$(ynh_app_setting_get $app final_path) #================================================= # STANDARD REMOVE From f549873fcf742020336e4bbc8fdfa723391b3165 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 21:33:30 +0100 Subject: [PATCH 31/32] removing dedicated removal --- scripts/remove | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/scripts/remove b/scripts/remove index b054f15..2eabd39 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,21 +41,6 @@ ynh_print_info "Stopping and removing the service" # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE YUNORUNNER DEPENDENCIES -#================================================= - -pushd $final_path - ve3/bin/pip3 uninstall -y -r requirements.txt -popd -/var/www/yunorunner/.pythonz/bin/pythonz install 3.6.6 - -#================================================= -# REMOVE PYTHON 3.6 AND PYTHONZ -#================================================= - -$final_path/.pythonz/bin/pythonz uninstall 3.6.6 -$final_path/.pythonz/bin/pythonz cleanup #================================================= # REMOVE DEPENDENCIES From 0b9ca08cffe2eb46a51ee5e584b5281f2c55fca7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 14 Feb 2019 22:54:44 +0100 Subject: [PATCH 32/32] Fix restore dependencies --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index b52ca8b..62550f5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,7 +81,7 @@ chown -R $app:root $final_path ynh_print_info "Reinstall dependencies..." # Define and install dependencies -ynh_install_app_dependencies python-virtualenv sqlite3 zlib1g-dev +ynh_install_app_dependencies python-virtualenv sqlite3 libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev #=================================================