mirror of
https://github.com/YunoHost-Apps/invidious_ynh.git
synced 2024-09-03 19:15:55 +02:00
extract from release
This commit is contained in:
parent
b19b17530c
commit
e927b7ec44
6 changed files with 16 additions and 57 deletions
|
@ -5,7 +5,7 @@ name = "Invidious"
|
|||
description.en = "Alternative front-end to YouTube"
|
||||
description.fr = "Front-end alternatif à YouTube"
|
||||
|
||||
version = "24.04.28~ynh1"
|
||||
version = "24.04.27~ynh1"
|
||||
|
||||
maintainers = []
|
||||
|
||||
|
@ -48,6 +48,11 @@ ram.runtime = "50M"
|
|||
default = "fr"
|
||||
|
||||
[resources]
|
||||
|
||||
[resources.sources.main]
|
||||
url = "https://github.com/iv-org/invidious/archive/refs/tags/v2.20240427.tar.gz"
|
||||
sha256 = "0f290de213eda898f95fd0108652738f88bb6d09289e0cea86c178050271660d"
|
||||
|
||||
[resources.system_user]
|
||||
|
||||
[resources.install_dir]
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
version_commit=eda7444ca46dbc3941205316baba8030fe0b2989
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -42,23 +42,10 @@ ynh_exec_warn_less curl -fsSL https://crystal-lang.org/install.sh | bash -s -- -
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..." --weight=4
|
||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||
|
||||
mkdir -p "$install_dir"
|
||||
chown -R "$app:www-data" "$install_dir"
|
||||
|
||||
git config --system --add safe.directory "$install_dir"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from GitHub
|
||||
# note: we can't use resources.sources instead of git because Invidious is
|
||||
# expecting to be in a git environment for the building step...
|
||||
# see: https://github.com/YunoHost-Apps/invidious_ynh/pull/127
|
||||
git clone https://github.com/iv-org/invidious "$install_dir" --quiet
|
||||
|
||||
pushd "$install_dir"
|
||||
git reset --hard --quiet "$version_commit"
|
||||
make
|
||||
popd
|
||||
# Download, check integrity, uncompress and patch the source from manifest.toml
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R "$app:www-data" "$install_dir"
|
||||
|
|
|
@ -22,11 +22,6 @@ then
|
|||
yunohost service remove "$app"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing system configurations related to $app..." --weight=10
|
||||
|
||||
dpkg --remove crystal
|
||||
|
||||
# Remove the dedicated systemd config
|
||||
|
|
|
@ -9,15 +9,6 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -49,6 +40,8 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable "$app.service" --quiet
|
||||
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -69,26 +63,13 @@ ynh_exec_warn_less curl -fsSL https://crystal-lang.org/install.sh | bash -s -- -
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=5
|
||||
|
||||
pushd "$install_dir"
|
||||
chown -R "$app:www-data" "$install_dir"
|
||||
git config --system --add safe.directory "$install_dir"
|
||||
ynh_exec_as "$app" git config pull.rebase false
|
||||
|
||||
ynh_exec_as "$app" git fetch
|
||||
#git checkout master
|
||||
ynh_exec_as "$app" git reset --hard --quiet "$version_commit"
|
||||
ynh_exec_as "$app" git pull
|
||||
# Download, check integrity, uncompress and patch the source from manifest.toml
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
ynh_exec_warn_less shards install --production
|
||||
ynh_exec_warn_less crystal build "$install_dir/src/invidious.cr" --release
|
||||
popd
|
||||
fi
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R "$app:www-data" "$install_dir"
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue