Skip to content

Commit

Permalink
Merge pull request #23 from YunoHost-Apps/testing
Browse files Browse the repository at this point in the history
Upgrade to v1.3.3, patch change_url
  • Loading branch information
tituspijean committed Apr 22, 2021
2 parents 453b137 + 7bbed9d commit 691b361
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 32 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -11,7 +11,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
## Overview
Flow-based programming for the Internet of Things.

**Shipped version:** 1.2.9
**Shipped version:** 1.3.3

## Screenshots

Expand Down Expand Up @@ -43,8 +43,8 @@ Since Node-Red can handle sensitive automation, the app is always installed in p

#### Supported architectures

* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nodered%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nodered/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nodered%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nodered/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nodered.svg)](https://ci-apps.yunohost.org/ci/apps/nodered/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nodered.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nodered/)

## Links

Expand Down
6 changes: 3 additions & 3 deletions README_fr.md
Expand Up @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble
Programmation par flux de données pour l'Internet des objets.

**Version incluse :** 1.2.9
**Version incluse :** 1.3.3

## Captures d'écran

Expand Down Expand Up @@ -43,8 +43,8 @@ Puisque les automatisations gérées par Node-Red peuvent être sensibles, l'app

#### Supported architectures

* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nodered%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/nodered/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nodered%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nodered/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/nodered.svg)](https://ci-apps.yunohost.org/ci/apps/nodered/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/nodered.svg)](https://ci-apps-arm.yunohost.org/ci/apps/nodered/)

## Liens

Expand Down
6 changes: 5 additions & 1 deletion check_process
Expand Up @@ -19,6 +19,7 @@
setup_public=0 #Considering the sensitive actions this app can do, I prefer to have it private
upgrade=1
upgrade=0 from_commit=567fc9435804add272fa4ae48a7cf1ec5f173d2d
upgrade=1 from_commit=453b13703bb418a7da33ed4f3e96a486b365d865
backup_restore=1
multi_instance=1
port_already_use=1
Expand All @@ -29,4 +30,7 @@ Notification=none
;;; Upgrade options
; commit=CommitHash
name=Name and date of the commit.
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&port=666&
; commit=453b13703bb418a7da33ed4f3e96a486b365d865
name=v1.2.9 2021-02-20
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&password=pass&port=666&
4 changes: 2 additions & 2 deletions conf/app.src
@@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/node-red/node-red/releases/download/1.2.9/node-red-1.2.9.zip
SOURCE_SUM=bed0649f9214b34fef80496b7477b891f4f5d3dc5a767d8622da23875dc93f27
SOURCE_URL=https://github.com/node-red/node-red/releases/download/1.3.3/node-red-1.3.3.zip
SOURCE_SUM=21337b5c0ad923961d616e2b2203ec5f82453320a7b70b69c4bd1c31ffddf1a3
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true
Expand Down
12 changes: 2 additions & 10 deletions manifest.json
Expand Up @@ -6,15 +6,15 @@
"en": "Flow-based programming for the Internet of Things",
"fr": "Programmation par flux de données pour l'Internet des objets"
},
"version": "1.2.9~ynh1",
"version": "1.3.3~ynh1",
"url": "https://nodered.org",
"license": "Apache-2.0",
"maintainer": {
"name": "tituspijean",
"email": "tituspijean@outlook.com"
},
"requirements": {
"yunohost": ">= 3.8.1"
"yunohost": ">= 4.1.7"
},
"multi_instance": true,
"services": [
Expand All @@ -25,19 +25,11 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for Node-RED",
"fr": "Choisissez un nom de domaine pour Node-RED"
},
"example": "example.com"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Node-RED",
"fr": "Choisissez un chemin pour Node-RED"
},
"example": "/nodered",
"default": "/nodered"
}
Expand Down
17 changes: 17 additions & 0 deletions scripts/change_url
Expand Up @@ -30,6 +30,23 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)

#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1

# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"

# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
#=================================================
Expand Down
3 changes: 1 addition & 2 deletions scripts/install
Expand Up @@ -43,7 +43,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1

ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=is_public --value=$is_public

#=================================================
# STANDARD MODIFICATIONS
Expand Down Expand Up @@ -88,7 +87,7 @@ chown -R $app: $final_path

pushd $final_path
ynh_use_nodejs
exec_as $app env PATH=$PATH npm install --production
ynh_exec_warn_less exec_as $app env PATH=$PATH npm install --production
popd

#=================================================
Expand Down
12 changes: 1 addition & 11 deletions scripts/upgrade
Expand Up @@ -19,7 +19,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
port=$(ynh_app_setting_get --app=$app --key=port)

#=================================================
Expand All @@ -33,15 +32,6 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1

# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
fi

# If final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/var/www/$app
Expand Down Expand Up @@ -125,7 +115,7 @@ chown -R $app: $final_path

pushd $final_path
ynh_use_nodejs
exec_as $app env PATH=$PATH npm install --production
ynh_exec_warn_less exec_as $app env PATH=$PATH npm install --production
popd

#=================================================
Expand Down

0 comments on commit 691b361

Please sign in to comment.