mirror of
https://github.com/YunoHost-Apps/diaspora_ynh.git
synced 2024-09-03 18:26:13 +02:00
Fix node version
This commit is contained in:
parent
4986e64d3f
commit
c95e407a6b
6 changed files with 28 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
pkg_dependencies="build-essential cmake libssl-dev libcurl4-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server nodejs postgresql bison "
|
||||
pkg_dependencies="build-essential cmake libssl-dev libcurl4-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server postgresql bison "
|
||||
ruby_build_dependencies="bison libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libyaml-dev pkg-config sqlite3 zlib1g-dev libgmp-dev libreadline-dev libssl-dev libjemalloc-dev"
|
||||
|
||||
current_tag="v0.7.17.0"
|
||||
|
|
|
@ -9,7 +9,9 @@ bin/bundle install --full-index --with=postgresql
|
|||
EOF
|
||||
# for some reason rake logs a lot in stderr (tried --quiet, didn't change anything)
|
||||
# redirecting it to stdout to have a saner log on yunohost side
|
||||
sudo -u $app --login << EOF
|
||||
sudo -u $app /bin/bash -l << EOF
|
||||
source /usr/share/yunohost/helpers
|
||||
ynh_use_nodejs
|
||||
cd diaspora
|
||||
RAILS_ENV=production bundle exec rake db:migrate 2>&1
|
||||
EOF
|
||||
|
@ -18,7 +20,9 @@ EOF
|
|||
# ASSETS PRECOMPILATION
|
||||
#=================================================
|
||||
|
||||
sudo -u $app --login << EOF
|
||||
sudo -u $app /bin/bash << EOF
|
||||
source /usr/share/yunohost/helpers
|
||||
ynh_use_nodejs
|
||||
cd diaspora
|
||||
RAILS_ENV=production bin/rake assets:precompile 2>&1
|
||||
EOF
|
||||
|
|
|
@ -90,10 +90,12 @@ chmod 0750 $final_path -R
|
|||
chown $app:www-data $final_path
|
||||
|
||||
#=================================================
|
||||
# INSTALL RVM AND RUBY FOR CURRENT USER
|
||||
# INSTALL RVM, RUBY AND NODE FOR CURRENT USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing rvm and ruby... (will take a long time)" --weight=20
|
||||
source ./install_ruby
|
||||
ynh_script_progression --message="Installing node" --weight=10
|
||||
ynh_install_nodejs --nodejs_version=14
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
|
|
@ -94,6 +94,12 @@ ynh_script_progression --message="Remove ruby (if this is the last app using it)
|
|||
source $final_path/Experimental_helpers/ynh_install_ruby/ynh_install_ruby
|
||||
ynh_remove_ruby
|
||||
|
||||
#=================================================
|
||||
# REMOVE NODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Remove nodejs for this app"
|
||||
ynh_remove_nodejs
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
|
|
|
@ -69,11 +69,12 @@ chmod 0750 $final_path -R
|
|||
chown $app:www-data $final_path
|
||||
|
||||
#=================================================
|
||||
# INSTALL RVM AND RUBY FOR CURRENT USER
|
||||
# INSTALL RVM, RUBY AND NODE FOR CURRENT USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling rbenv and ruby..." --weight=10
|
||||
|
||||
source ./install_ruby
|
||||
ynh_script_progression --message="Reinstalling node" --weight=10
|
||||
ynh_install_nodejs --nodejs_version=14
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
|
|
@ -58,17 +58,25 @@ ynh_script_progression --message="Installing dependencies..."
|
|||
|
||||
ynh_install_app_dependencies $pkg_dependencies $ruby_build_dependencies
|
||||
|
||||
#=================================================
|
||||
# INSTALL NODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Install node"
|
||||
ynh_install_nodejs --nodejs_version=14
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
# migrate from rvm to rbenv
|
||||
ynh_script_progression --message="Remove rvm..."
|
||||
ynh_script_progression --message="Remove rvm if needed..."
|
||||
if [ -e "$final_path/.rvm" ]; then
|
||||
sudo -u $app --login << EOF
|
||||
rvm implode --force
|
||||
EOF
|
||||
fi
|
||||
ynh_script_progression --message="Install ruby"
|
||||
source ./install_ruby
|
||||
|
||||
# remove old gpg keys for rvm
|
||||
ynh_script_progression --message="Remove old rvm keys..."
|
||||
if gpg --list-keys mpapis@gmail.com >/dev/null 2>&1; then
|
||||
|
|
Loading…
Reference in a new issue