Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat bump to v4.1.1 #56

Closed
wants to merge 12 commits into from
345 changes: 212 additions & 133 deletions conf/ampache.cfg.php

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions conf/app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/ampache/ampache/archive/3.9.0.tar.gz
SOURCE_SUM=1e523b52c6402693102dac183d7597d6e0aebf63580167f45661d0f15f57c072
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_URL=https://github.com/ampache/ampache/releases/download/4.1.1/ampache-4.1.1_all.zip
SOURCE_SUM=eb958442fcc0c6377f9070baa7db13b4
SOURCE_SUM_PRG=md5sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=
2 changes: 1 addition & 1 deletion conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ location __PATH__/ {
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
fastcgi_pass unix:/var/run/php/php__YNH_PHP_VERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
Expand Down
430 changes: 0 additions & 430 deletions conf/php-fpm.conf

This file was deleted.

6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"en": "A web based audio/video streaming application",
"fr": "Une application de streaming audio et vidéo"
},
"version": "3.9.0~ynh2",
"version": "4.1.1~ynh",
"url": "http://ampache.org",
"license": "AGPL-3.0",
"maintainer": {
Expand All @@ -15,11 +15,11 @@
},
"multi_instance": true,
"requirements": {
"yunohost": ">= 3.5.0"
"yunohost": ">= 3.8.0"
},
"services" : [
"nginx",
"php7.0-fpm",
"php7.3-fpm",
"mysql"
],
"arguments": {
Expand Down
7 changes: 7 additions & 0 deletions scripts/_common.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================

pkg_dependencies="libav-tools"
YNH_PHP_VERSION="7.3"
extra_php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap"

#=================================================
# EXPERIMENTAL HELPERS
Expand Down
16 changes: 3 additions & 13 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=25

ynh_install_app_dependencies libav-tools php-cli
ynh_install_app_dependencies $pkg_dependencies

#=================================================
# CREATE A MYSQL DATABASE
Expand All @@ -81,7 +81,7 @@ ynh_setup_source --dest_dir="$final_path"
ynh_script_progression --message="Configuring nginx web server..."

# Create a dedicated nginx config
ynh_add_nginx_config
ynh_add_nginx_config YNH_PHP_VERSION

#=================================================
# CREATE DEDICATED USER
Expand All @@ -97,7 +97,7 @@ ynh_system_user_create --username=$app
ynh_script_progression --message="Configuring php-fpm..."

# Create a dedicated php-fpm config
ynh_add_fpm_config
ynh_add_fpm_config --usage=low --footprint=low --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"

#=================================================
# SPECIFIC SETUP
Expand Down Expand Up @@ -128,16 +128,6 @@ ynh_store_file_checksum --file="$conf_file"
# Load default ampache database
ynh_mysql_connect_as --user=$app --password="$db_pwd" --database=$app < "$final_path/sql/ampache.sql"

#=================================================
# INSTALL AMPACHE WITH COMPOSER
#=================================================
ynh_script_progression --message="Installing ampache with composer..." --weight=45

# Install composer
ynh_install_composer

ynh_exec_warn_less ynh_composer_exec --commands=\"install --prefer-source --no-dev\"

#=================================================
# INSTALL MULTIMEDIA DIRECTORIES
#=================================================
Expand Down
35 changes: 21 additions & 14 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)

fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)

#=================================================
# CHECK VERSION
#=================================================
Expand Down Expand Up @@ -68,6 +71,18 @@ fi

ynh_app_setting_delete --app=$app --key=skipped_uris

# If fpm_footprint doesn't exist, create it
if [ -z "$fpm_footprint" ]; then
fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi

# If fpm_usage doesn't exist, create it
if [ -z "$fpm_usage" ]; then
fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi

#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
Expand Down Expand Up @@ -106,15 +121,16 @@ fi
#=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=3

# Create a dedicated nginx config
ynh_add_nginx_config
# Re-create a dedicated nginx config
ynh_remove_nginx_config
ynh_add_nginx_config YNH_PHP_VERSION

#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=5

ynh_install_app_dependencies libav-tools php-cli
ynh_install_app_dependencies $pkg_dependencies

#=================================================
# CREATE DEDICATED USER
Expand All @@ -130,7 +146,7 @@ ynh_system_user_create --username=$app
ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=2

# Create a dedicated php-fpm config
ynh_add_fpm_config
ynh_add_fpm_config --phpversion="$YNH_PHP_VERSION" --usage=$fpm_usage --footprint=$fpm_footprint --package="$extra_php_dependencies"

#=================================================
# SPECIFIC UPGRADE
Expand All @@ -145,6 +161,7 @@ then
conf_file="$final_path/config/ampache.cfg.php"
ynh_backup_if_checksum_is_different --file="$conf_file"

cp ../conf/ampache.cfg.php "$conf_file"
ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$conf_file"
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$conf_file"
Expand All @@ -156,16 +173,6 @@ then
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$conf_file"

#=================================================
# UPDATE AMPACHE WITH COMPOSER
#=================================================
ynh_script_progression --message="Upgrading ampache with composer..." --weight=30

# Install composer
ynh_install_composer

ynh_composer_exec --commands="config discard-changes true"
ynh_composer_exec --commands="update --prefer-source --no-interaction --no-dev"
fi

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