mirror of
https://github.com/YunoHost-Apps/misskey_ynh.git
synced 2024-09-03 19:46:03 +02:00
Merge d2f8024fd7
into 6daf1d53b6
This commit is contained in:
commit
11189c0798
7 changed files with 32 additions and 24 deletions
|
@ -1,4 +1,6 @@
|
|||
;; Test complet
|
||||
; pre-install
|
||||
git config --system --add safe.directory /var/www/misskey
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
is_public=1
|
||||
|
@ -19,6 +21,4 @@
|
|||
Email=
|
||||
Notification=
|
||||
;;; Upgrade options
|
||||
; commit=d0b5378eb020818020114d647a56158caed1600e
|
||||
name=12.109.2~ynh1
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
SOURCE_URL=https://github.com/misskey-dev/misskey/archive/refs/tags/12.119.2.tar.gz
|
||||
SOURCE_SUM=0620c8d4ee82f3bfa5749197b719cff606628413875589918df58f71cae9df57
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=tar.gz
|
||||
SOURCE_IN_SUBDIR=true
|
Binary file not shown.
Before Width: | Height: | Size: 641 KiB |
|
@ -4,7 +4,9 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
NODEJS_VERSION="16.15.0"
|
||||
NODEJS_VERSION="18.13.0"
|
||||
|
||||
COMMIT="c75fc266e9b3704d92e462660761baba980188cd"
|
||||
|
||||
# dependencies used by the app
|
||||
pkg_dependencies="ffmpeg postgresql"
|
||||
|
|
|
@ -72,7 +72,6 @@ ynh_script_progression --message="Installing dependencies..." --weight=3
|
|||
|
||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -99,8 +98,13 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
|
|||
ynh_script_progression --message="Setting up source files..." --weight=3
|
||||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
# Note: We use git instead of ynh_setup_source, cause this repo use submodules
|
||||
git clone https://github.com/misskey-dev/misskey.git "$final_path" --quiet
|
||||
|
||||
pushd "$final_path"
|
||||
git checkout $COMMIT --quiet
|
||||
git submodule update --init
|
||||
popd
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
|
@ -125,6 +129,7 @@ ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db"
|
|||
|
||||
ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml"
|
||||
|
||||
|
||||
#=================================================
|
||||
# BUILD APP
|
||||
#=================================================
|
||||
|
@ -132,9 +137,10 @@ ynh_script_progression --message="Building app..." --weight=15
|
|||
|
||||
pushd "$final_path"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn add ts-node webpack
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run init
|
||||
corepack enable
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install --frozen-lockfile
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm run init
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -73,7 +73,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=5
|
|||
# Define and install dependencies
|
||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
|
|
|
@ -34,7 +34,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
||||
if ynh_compare_current_package_version --comparison lt --version 12.105.0~ynh1
|
||||
if ynh_compare_current_package_version --comparison lt --version 12.109.2~ynh1
|
||||
then
|
||||
ynh_die --message="Sorry, this version is not upgradable to the latest version :("
|
||||
fi
|
||||
|
@ -103,10 +103,17 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading source files..."
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=5
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path" --keep=".config/default.yml"
|
||||
pushd "$final_path"
|
||||
git config --system --add safe.directory $final_path
|
||||
git checkout master
|
||||
git config --system --add safe.directory $final_path/fluent-emojis
|
||||
git config --system --add safe.directory $final_path/misskey-assets
|
||||
git pull origin master --quiet
|
||||
git checkout $COMMIT --quiet
|
||||
git submodule update --init --quiet
|
||||
popd
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
|
@ -120,7 +127,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=5
|
|||
|
||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
@ -137,10 +143,10 @@ ynh_script_progression --message="Building app..."
|
|||
|
||||
pushd "$final_path"
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cleanall
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production yarn build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn migrate
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm clean-all
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install --frozen-lockfile
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build
|
||||
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm migrate
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue