1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/concrete5_ynh.git synced 2024-09-03 18:25:54 +02:00

Merge pull request #20 from YunoHost-Apps/upgrade

Upgrade
This commit is contained in:
yalh76 2022-05-26 00:14:11 +02:00 committed by GitHub
commit 5f5e3facdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 88 additions and 93 deletions

View file

@ -9,9 +9,6 @@
# Since each app is different, maintainers can adapt its contents so as to perform
# automatic actions when a new upstream release is detected.
# Remove this exit command when you are ready to run this Action
#exit 1
#=================================================
# FETCHING LATEST RELEASE AND ITS ASSETS
#=================================================
@ -20,8 +17,8 @@
current_version=$(cat manifest.json | jq -j '.version|split("~")[0]')
repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]')
# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions)
version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'"))
version=$(curl --location --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
assets="https://github.com/concretecms/concretecms/archive/refs/tags/$version.tar.gz"
# Later down the script, we assume the version has only digits and dots
# Sometimes the release name starts with a "v", so let's filter it out.
@ -34,6 +31,7 @@ fi
echo "Current version: $current_version"
echo "Latest release from upstream: $version"
echo "VERSION=$version" >> $GITHUB_ENV
echo "REPO=$repo" >> $GITHUB_ENV
# For the time being, let's assume the script will fail
echo "PROCEED=false" >> $GITHUB_ENV
@ -47,32 +45,16 @@ elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.
exit 0
fi
# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.)
echo "${#assets[@]} available asset(s)"
#=================================================
# UPDATE SOURCE FILES
#=================================================
# Here we use the $assets variable to get the resources published in the upstream release.
# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like.
# Let's loop over the array of assets URLs
for asset_url in ${assets[@]}; do
# Let's download source tarball
asset_url=$assets
echo "Handling asset at $asset_url"
# Assign the asset to a source file in conf/ directory
# Here we base the source file name upon a unique keyword in the assets url (admin vs. update)
# Leave $src empty to ignore the asset
case $asset_url in
*".tar.gz"*)
src="app"
;;
esac
# If $src is not empty, let's process the asset
if [ ! -z "$src" ]; then
src="app"
# Create the temporary directory
tempdir="$(mktemp -d)"
@ -97,17 +79,12 @@ cat <<EOT > conf/$src.src
SOURCE_URL=$asset_url
SOURCE_SUM=$checksum
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_FORMAT=$extension
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
EOT
echo "... conf/$src.src updated"
else
echo "... asset ignored"
fi
done
#=================================================
# SPECIFIC UPDATE STEPS
#=================================================

View file

@ -47,3 +47,4 @@ jobs:
body: |
Upgrade to v${{ env.VERSION }}
draft: false

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Concrete5 for YunoHost
[![Integration level](https://dash.yunohost.org/integration/concrete5.svg)](https://dash.yunohost.org/appci/app/concrete5) ![](https://ci-apps.yunohost.org/ci/badges/concrete5.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/concrete5.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/concrete5.svg)](https://dash.yunohost.org/appci/app/concrete5) ![Working status](https://ci-apps.yunohost.org/ci/badges/concrete5.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/concrete5.maintain.svg)
[![Install Concrete5 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=concrete5)
*[Lire ce readme en français.](./README_fr.md)*
@ -15,12 +15,18 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
Open Source Content Management System for Teams
**Shipped version:** 9.0.1~ynh1
Concrete5 is a modern CMS.
Features :
* SEO Tools
* User mangament
* Secure
* Intuitive Editing
* Theme and Block management
* Marketing tools
* **and more**...
**Shipped version:** 9.0.1~ynh2
## Disclaimers / important information
* Any known limitations, constrains or stuff not working, such as (but not limited to):
@ -28,21 +34,22 @@ Open Source Content Management System for Teams
## Documentation and resources
* Official app website: https://www.concrete5.org/
* Official admin documentation: https://documentation.concrete5.org/
* Upstream app code repository: https://github.com/concrete5/concrete5
* YunoHost documentation for this app: https://yunohost.org/app_concrete5
* Report a bug: https://github.com/YunoHost-Apps/concrete5_ynh/issues
* Official app website: <https://www.concrete5.org/>
* Official admin documentation: <https://documentation.concrete5.org/>
* Upstream app code repository: <https://github.com/concrete5/concrete5>
* YunoHost documentation for this app: <https://yunohost.org/app_concrete5>
* Report a bug: <https://github.com/YunoHost-Apps/concrete5_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/concrete5_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/concrete5_ynh/tree/testing --debug
or
sudo yunohost app upgrade concrete5 -u https://github.com/YunoHost-Apps/concrete5_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,22 +1,32 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Concrete5 pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/concrete5.svg)](https://dash.yunohost.org/appci/app/concrete5) ![](https://ci-apps.yunohost.org/ci/badges/concrete5.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/concrete5.maintain.svg)
[![Niveau d'intégration](https://dash.yunohost.org/integration/concrete5.svg)](https://dash.yunohost.org/appci/app/concrete5) ![Status du fonctionnement](https://ci-apps.yunohost.org/ci/badges/concrete5.status.svg) ![Status de maintenance](https://ci-apps.yunohost.org/ci/badges/concrete5.maintain.svg)
[![Installer Concrete5 avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=concrete5)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Concrete5 rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble
Système de gestion de contenu Open Source pour les équipes
**Version incluse :** 9.0.1~ynh1
Concrete5 is a modern CMS.
Features :
* SEO Tools
* User mangament
* Secure
* Intuitive Editing
* Theme and Block management
* Marketing tools
* **and more**...
**Version incluse :** 9.0.1~ynh2
## Avertissements / informations importantes
* Any known limitations, constrains or stuff not working, such as (but not limited to):
@ -24,21 +34,22 @@ Système de gestion de contenu Open Source pour les équipes
## Documentations et ressources
* Site officiel de l'app : https://www.concrete5.org/
* Documentation officielle de l'admin : https://documentation.concrete5.org/
* Dépôt de code officiel de l'app : https://github.com/concrete5/concrete5
* Documentation YunoHost pour cette app : https://yunohost.org/app_concrete5
* Signaler un bug : https://github.com/YunoHost-Apps/concrete5_ynh/issues
* Site officiel de l'app : <https://www.concrete5.org/>
* Documentation officielle de l'admin : <https://documentation.concrete5.org/>
* Dépôt de code officiel de l'app : <https://github.com/concrete5/concrete5>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_concrete5>
* Signaler un bug : <https://github.com/YunoHost-Apps/concrete5_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/concrete5_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/concrete5_ynh/tree/testing --debug
ou
sudo yunohost app upgrade concrete5 -u https://github.com/YunoHost-Apps/concrete5_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -2,9 +2,9 @@
; Manifest
domain="domain.tld"
path="/path"
admin="john"
language="fr_FR"
is_public=1
language="fr_FR"
admin="john"
password="1Strong-Password"
website_title="site"
; Checks

View file

@ -1,5 +1,7 @@
SOURCE_URL=https://github.com/concrete5/concrete5/archive/9.0.1.tar.gz
SOURCE_SUM=348debdff928b5fb777dde762c1521311d01a3cb09c325b68f5ee7d0f61e0d03
SOURCE_SUM=0dc5d37da948c1b5bab4dc8291e9a97488cb53f521c8e56cf118008ae99f9e38
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true

9
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,9 @@
Concrete5 is a modern CMS.
Features :
* SEO Tools
* User mangament
* Secure
* Intuitive Editing
* Theme and Block management
* Marketing tools
* **and more**...

View file

@ -6,7 +6,7 @@
"en": "Open Source Content Management System for Teams",
"fr": "Système de gestion de contenu Open Source pour les équipes"
},
"version": "9.0.1~ynh1",
"version": "9.0.1~ynh2",
"url": "www.concrete5.org",
"upstream": {
"license": "MIT",
@ -29,7 +29,7 @@
"mysql"
],
"arguments": {
"install" : [
"install": [
{
"name": "domain",
"type": "domain"
@ -40,10 +40,6 @@
"example": "/concrete",
"default": "/concrete"
},
{
"name": "admin",
"type": "user"
},
{
"name": "is_public",
"type": "boolean",
@ -59,6 +55,10 @@
"choices": ["en_US", "fr_FR", "de_DE", "pt_PT"],
"default": "en_US"
},
{
"name": "admin",
"type": "user"
},
{
"name": "password",
"type": "password"

View file

@ -1,10 +0,0 @@
build_settings:
clone_depth: 1 # depth of 1 is a shallow clone, remove this line to clone entire repo
setup:
shell :
command: "/home/package_check/package_check.sh -f -y %BUILD_PATH%"
complete:
email:
default_mailto_address: abld@tutanota.com

View file

@ -25,12 +25,12 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
admin=$YNH_APP_ARG_ADMIN
password=$YNH_APP_ARG_PASSWORD
website_title=$YNH_APP_ARG_WEBSITE_TITLE
admin_email=$(ynh_user_get_info $admin 'mail')
admin_email=$(ynh_user_get_info --username=$admin --key="mail")
app=$YNH_APP_INSTANCE_NAME
@ -52,8 +52,8 @@ ynh_script_progression --message="Storing installation settings..."
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=admin --value=$admin
ynh_app_setting_set --app=$app --key=language --value=$language
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=admin_email --value=$admin_email
ynh_app_setting_set --app=$app --key=website_title --value=$website_title
@ -72,7 +72,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# CREATE A MYSQL DATABASE

View file

@ -31,14 +31,6 @@ ynh_script_progression --message="Removing the MySQL database..."
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
@ -63,6 +55,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..."
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -39,8 +39,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
@ -59,7 +57,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR

View file

@ -18,11 +18,10 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
language=$(ynh_app_setting_get --app=$app --key=language)
admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
language=$(ynh_app_setting_get --app=$app --key=language)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK VERSION
@ -65,7 +64,7 @@ fi
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -105,6 +104,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# SPECIFIC UPGRADE