mirror of
https://github.com/YunoHost-Apps/omeka-s_ynh.git
synced 2024-09-03 19:56:05 +02:00
commit
670714ec5f
7 changed files with 13 additions and 86 deletions
6
.github/workflows/updater.sh
vendored
6
.github/workflows/updater.sh
vendored
|
@ -17,8 +17,8 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Fetching information
|
# Fetching information
|
||||||
current_version=$(cat manifest.json | jq -j '.version|split("~")[0]')
|
current_version=$(cat manifest.toml | jq -j '.version|split("~")[0]')
|
||||||
repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]')
|
repo=$(cat manifest.toml | 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)
|
# 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)
|
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 "'"))
|
assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'"))
|
||||||
|
@ -122,7 +122,7 @@ done
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Replace new version in manifest
|
# Replace new version in manifest
|
||||||
echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json
|
echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.toml)" > manifest.toml
|
||||||
|
|
||||||
# No need to update the README, yunohost-bot takes care of it
|
# No need to update the README, yunohost-bot takes care of it
|
||||||
|
|
||||||
|
|
4
.github/workflows/updater.yml
vendored
4
.github/workflows/updater.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch the source code
|
- name: Fetch the source code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Run the updater script
|
- name: Run the updater script
|
||||||
|
@ -33,7 +33,7 @@ jobs:
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
id: cpr
|
id: cpr
|
||||||
if: ${{ env.PROCEED == 'true' }}
|
if: ${{ env.PROCEED == 'true' }}
|
||||||
uses: peter-evans/create-pull-request@v3
|
uses: peter-evans/create-pull-request@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
commit-message: Update to version ${{ env.VERSION }}
|
commit-message: Update to version ${{ env.VERSION }}
|
||||||
|
|
|
@ -23,7 +23,7 @@ Omeka S is a web publication system for universities, galleries, libraries, arch
|
||||||
- Connect to the semantic Web
|
- Connect to the semantic Web
|
||||||
- Share with DPLA
|
- Share with DPLA
|
||||||
|
|
||||||
**Shipped version:** 4.0.0~ynh2
|
**Shipped version:** 4.0.1~ynh1
|
||||||
|
|
||||||
**Demo:** https://omeka.org/s/download/#sandbox
|
**Demo:** https://omeka.org/s/download/#sandbox
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ Omeka S is a web publication system for universities, galleries, libraries, arch
|
||||||
- Connect to the semantic Web
|
- Connect to the semantic Web
|
||||||
- Share with DPLA
|
- Share with DPLA
|
||||||
|
|
||||||
**Version incluse :** 4.0.0~ynh2
|
**Version incluse :** 4.0.1~ynh1
|
||||||
|
|
||||||
**Démo :** https://omeka.org/s/download/#sandbox
|
**Démo :** https://omeka.org/s/download/#sandbox
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/omeka/omeka-s/releases/download/v4.0.0/omeka-s-4.0.0.zip
|
SOURCE_URL=https://github.com/omeka/omeka-s/releases/download/v4.0.1/omeka-s-4.0.1.zip
|
||||||
SOURCE_SUM=bbc103ce6beefe780811f7499da2fd4ab678db0bbda9f532ab3b64cd741d11f5
|
SOURCE_SUM=2d682b77c95bd9d0ab0a846527b6351acaced571c293b637e731ff7f0193ba37
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=zip
|
SOURCE_FORMAT=zip
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -5,7 +5,7 @@ name = "Omeka S"
|
||||||
description.en = "Web publication system for universities, galleries, libraries, archives, and museums"
|
description.en = "Web publication system for universities, galleries, libraries, archives, and museums"
|
||||||
description.fr = "Système de publication Web pour les universités, les galeries, les bibliothèques, les archives et les musées"
|
description.fr = "Système de publication Web pour les universités, les galeries, les bibliothèques, les archives et les musées"
|
||||||
|
|
||||||
version = "4.0.0~ynh2"
|
version = "4.0.1~ynh1"
|
||||||
|
|
||||||
maintainers = ["eric_G"]
|
maintainers = ["eric_G"]
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ userdoc = "https://omeka.org/s/docs/user-manual/"
|
||||||
code = "https://github.com/omeka/omeka-s"
|
code = "https://github.com/omeka/omeka-s"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.1.8"
|
yunohost = ">= 11.1.12"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
ldap = false
|
ldap = false
|
||||||
|
@ -49,7 +49,7 @@ ram.runtime = "50M"
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
|
||||||
[resources.apt]
|
[resources.apt]
|
||||||
packages = "imagemagick php8.1-mysql php8.1-gd php8.1-mbstring php8.1-xml"
|
packages = "mariadb-server imagemagick php8.1-mysql php8.1-gd php8.1-mbstring php8.1-xml"
|
||||||
|
|
||||||
[resources.database]
|
[resources.database]
|
||||||
type = "mysql"
|
type = "mysql"
|
||||||
|
|
|
@ -6,87 +6,14 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source _common.sh
|
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
old_domain=$YNH_APP_OLD_DOMAIN
|
|
||||||
old_path=$YNH_APP_OLD_PATH
|
|
||||||
|
|
||||||
new_domain=$YNH_APP_NEW_DOMAIN
|
|
||||||
new_path=$YNH_APP_NEW_PATH
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --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
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
change_domain=0
|
|
||||||
if [ "$old_domain" != "$new_domain" ]
|
|
||||||
then
|
|
||||||
change_domain=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
change_path=0
|
|
||||||
if [ "$old_path" != "$new_path" ]
|
|
||||||
then
|
|
||||||
change_path=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
ynh_change_url_nginx_config
|
||||||
|
|
||||||
# Change the path in the NGINX config file
|
|
||||||
if [ $change_path -eq 1 ]
|
|
||||||
then
|
|
||||||
# Make a backup of the original NGINX config file if modified
|
|
||||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
|
||||||
# Set global variables for NGINX helper
|
|
||||||
domain="$old_domain"
|
|
||||||
path_url="$new_path"
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change the domain for NGINX
|
|
||||||
if [ $change_domain -eq 1 ]
|
|
||||||
then
|
|
||||||
# Delete file checksum for the old conf file location
|
|
||||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
|
||||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
|
||||||
# Store file checksum for the new config file location
|
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Reference in a new issue