1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/snweb_ynh.git synced 2024-09-03 20:26:22 +02:00

Update installer

This commit is contained in:
Fabian Wilkens 2021-03-20 13:37:41 +01:00
parent ad5382194f
commit 603eeea2e0
No known key found for this signature in database
GPG key ID: 23DFA025BB4E9FAB
3 changed files with 14 additions and 39 deletions

View file

@ -84,6 +84,7 @@ ynh_script_progression --message="Setting up source files..." --weight=16
git clone $SOURCE "$final_path/live" --quiet
pushd "$final_path/live"
git checkout $COMMIT --quiet
git submodule update --init --recursive --quiet
popd
#=================================================
@ -110,6 +111,8 @@ ynh_system_user_create --username=$app --home_dir=$final_path
ynh_script_progression --message="Installing Ruby... ( This may take a while... )" --weight=100 #212
ynh_install_ruby --ruby_version=$RUBY_VERSION
/opt/rbenv/versions/$RUBY_VERSION/bin/gem update --system --no-document --quiet
/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --no-document --quiet
#=================================================
# MODIFY A CONFIG FILE
@ -134,19 +137,15 @@ ynh_replace_string --match_string="SF_DEFAULT_SERVER=http://localhost:3000" --re
#=================================================
ynh_script_progression --message="Building... ( This may take a while... )" --weight=100 #497
ENV_PATH="$ynh_node_load_PATH:/opt/rbenv/versions/$RUBY_VERSION/bin"
chown -R $app: "$final_path"
pushd "$final_path/live"
git submodule update --init --recursive --quiet
ynh_use_nodejs
/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --quiet
/opt/rbenv/versions/$RUBY_VERSION/bin/bundler install --quiet
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set --local path 'vendor/bundle'
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development'
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet
exec_as $app $ENV_PATH yarn install --pure-lockfile
exec_as $app $ENV_PATH yarn bundle
exec_as $app env PATH=$ynh_node_load_PATH yarn install --pure-lockfile
exec_as $app env PATH=$ynh_node_load_PATH yarn bundle
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet
popd
@ -159,7 +158,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=3
# Create a dedicated systemd config
ynh_add_systemd_config --others_var="\
port \
ENV_PATH \
RUBY_VERSION \
"

View file

@ -88,29 +88,8 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_install_ruby --ruby_version=$RUBY_VERSION
#=================================================
# BUILDING
#=================================================
ynh_script_progression --message="Reinstalling $app... ( This may take a while... )" --weight=100 #222
ENV_PATH="$ynh_node_load_PATH:/opt/rbenv/versions/$RUBY_VERSION/bin"
chown -R $app: "$final_path"
pushd "$final_path/live"
git submodule update --init --recursive --quiet
ynh_use_nodejs
/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --quiet
/opt/rbenv/versions/$RUBY_VERSION/bin/bundler install --quiet
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set --local path 'vendor/bundle'
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet
exec_as $app $ENV_PATH yarn install --pure-lockfile
exec_as $app $ENV_PATH yarn bundle
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet
popd
/opt/rbenv/versions/$RUBY_VERSION/bin/gem update --system --no-document --quiet
/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --no-document --quiet
#=================================================
# RESTORE USER RIGHTS

View file

@ -103,6 +103,7 @@ then
git clone $SOURCE "$final_path/live" --quiet
pushd "$final_path/live"
git checkout $COMMIT --quiet
git submodule update --init --recursive --quiet
popd
# Restore files
if [ -d $tmpdir/log ] ; then
@ -135,6 +136,8 @@ ynh_system_user_create --username=$app --home_dir=$final_path
ynh_script_progression --message="Installing Ruby... ( This may take a while... )" --weight=100 #331
ynh_install_ruby --ruby_version=$RUBY_VERSION
/opt/rbenv/versions/$RUBY_VERSION/bin/gem update --system --no-document --quiet
/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --no-document --quiet
#=================================================
# MODIFY A CONFIG FILE
@ -163,19 +166,15 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Building... ( This may take a while... )" --weight=100 #131
ENV_PATH="$ynh_node_load_PATH:/opt/rbenv/versions/$RUBY_VERSION/bin"
chown -R $app: "$final_path"
pushd "$final_path/live"
git submodule update --init --recursive --quiet
ynh_use_nodejs
/opt/rbenv/versions/$RUBY_VERSION/bin/gem install bundler --quiet
/opt/rbenv/versions/$RUBY_VERSION/bin/bundler install --quiet
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set --local path 'vendor/bundle'
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle config set with 'development'
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet
exec_as $app $ENV_PATH yarn install --pure-lockfile
exec_as $app $ENV_PATH yarn bundle
exec_as $app env PATH=$ynh_node_load_PATH yarn install --pure-lockfile
exec_as $app env PATH=$ynh_node_load_PATH yarn bundle
exec_as $app /opt/rbenv/versions/$RUBY_VERSION/bin/bundle exec rails assets:precompile --quiet
popd
fi
@ -188,7 +187,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=4
# Create a dedicated systemd config
ynh_add_systemd_config --others_var="\
port \
ENV_PATH \
RUBY_VERSION \
"