aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2021-03-07 20:17:05 +0100
committeryalh76 <yalh@yahoo.com>2021-03-07 20:17:05 +0100
commitc4c79475213f752a42d427a9be4be25b5dcca02e (patch)
tree93fe8b00d8ceb290b2d8b20527dc3e5d752a0440
parent0fbd6a19a1f413cfa05480cf44f33f4edff0f655 (diff)
downloadmastodon_ynh-c4c79475213f752a42d427a9be4be25b5dcca02e.tar.gz
mastodon_ynh-c4c79475213f752a42d427a9be4be25b5dcca02e.tar.bz2
mastodon_ynh-c4c79475213f752a42d427a9be4be25b5dcca02e.zip
simplification
-rw-r--r--scripts/_common.sh2
-rw-r--r--scripts/install22
-rw-r--r--scripts/restore4
-rw-r--r--scripts/upgrade20
4 files changed, 24 insertions, 24 deletions
diff --git a/scripts/_common.sh b/scripts/_common.sh
index 1c28aec..b6f4796 100644
--- a/scripts/_common.sh
+++ b/scripts/_common.sh
@@ -10,7 +10,7 @@ pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git
MEMORY_NEEDED="2560"
RUBY_VERSION="2.7.2"
-BUNDLER_VERSION="1.17.3"
+
NODEJS_VERSION="12"
#=================================================
diff --git a/scripts/install b/scripts/install
index 977f0b6..a390c66 100644
--- a/scripts/install
+++ b/scripts/install
@@ -145,8 +145,8 @@ ynh_script_progression --message="Installing Ruby..."
pushd "$final_path/live"
ynh_use_ruby
- $ynh_gem update --system
- $ynh_gem install bundler:$BUNDLER_VERSION --no-document
+ ynh_gem update --system
+ ynh_gem install bundler --no-document
popd
#=================================================
@@ -182,17 +182,17 @@ ynh_script_progression --message="Installing Mastodon..."
chown -R "$app": "$final_path"
pushd "$final_path/live"
- sudo -u $app $ynh_ruby_load_path $ruby_path/bundle config deployment 'true'
- sudo -u $app $ynh_ruby_load_path $ruby_path/bundle config without 'development test'
- sudo -u $app $ynh_ruby_load_path $ruby_path/bundle install -j$(getconf _NPROCESSORS_ONLN)
+ sudo -u $app bin/bundle config deployment 'true'
+ sudo -u $app bin/bundle config without 'development test'
+ sudo -u $app bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
echo "SAFETY_ASSURED=1">> $config
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path $ruby_path/bundle exec rails db:setup --quiet
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path $ruby_path/bundle exec rails assets:precompile --quiet
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path $ruby_path/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl accounts modify "$admin" --approve
+ sudo -u $app RAILS_ENV=production bin/bundle exec rails db:setup --quiet
+ sudo -u $app RAILS_ENV=production bin/bundle exec rails assets:precompile --quiet
+ sudo -u $app RAILS_ENV=production bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
+ sudo -u $app RAILS_ENV=production bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=admin > /dev/null
+ sudo -u $app RAILS_ENV=production bin/tootctl accounts modify "$admin" --approve
popd
vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt")
@@ -254,7 +254,7 @@ yunohost service add "$app-streaming" --description "$app streaming service"
#=================================================
ynh_script_progression --message="Starting a systemd service..."
-ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on tcp"
+ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on"
ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Schedules Loaded"
ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=systemd --line_match="Worker 1 now listening"
diff --git a/scripts/restore b/scripts/restore
index 6744ddb..19a7715 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -113,7 +113,7 @@ ynh_script_progression --message="Installing Ruby..."
ynh_install_ruby --ruby_version=$RUBY_VERSION
pushd "$final_path/live"
gem update --system
- gem install bundler:$BUNDLER_VERSION --no-document
+ gem install bundler --no-document
popd
#=================================================
@@ -150,7 +150,7 @@ yunohost service add "$app-streaming" --description "$app streaming service"
#=================================================
ynh_script_progression --message="Starting a systemd service..."
-ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on tcp"
+ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on"
ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Schedules Loaded"
ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=systemd --line_match="Worker 1 now listening"
diff --git a/scripts/upgrade b/scripts/upgrade
index 2e8753b..3f81e57 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -222,8 +222,8 @@ ynh_script_progression --message="Installing Ruby..."
pushd "$final_path/live"
ynh_use_ruby
- $ynh_gem update --system
- $ynh_gem install bundler:$BUNDLER_VERSION --no-document
+ ynh_gem update --system
+ ynh_gem install bundler --no-document
popd
#=================================================
@@ -243,15 +243,15 @@ ynh_script_progression --message="Upgrading Mastodon..."
chown -R "$app": "$final_path"
pushd "$final_path/live"
- sudo -u $app $ynh_ruby_load_path $ruby_path/bundle config deployment 'true'
- sudo -u $app $ynh_ruby_load_path $ruby_path/bundle config without 'development test'
- sudo -u $app $ynh_ruby_load_path $ruby_path/bundle install -j$(getconf _NPROCESSORS_ONLN)
+ sudo -u $app bin/bundle config deployment 'true'
+ sudo -u $app bin/bundle config without 'development test'
+ sudo -u $app bin/bundle install -j$(getconf _NPROCESSORS_ONLN)
ynh_use_nodejs
sudo -u $app $ynh_node_load_PATH yarn install --pure-lockfile
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path $ruby_path/bundle exec rails assets:clean
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path $ruby_path/bundle exec rails assets:precompile
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path $ruby_path/bundle exec rails db:migrate
- sudo -u $app RAILS_ENV=production $ynh_ruby_load_path bin/tootctl cache clear
+ sudo -u $app RAILS_ENV=production bin/bundle exec rails assets:clean
+ sudo -u $app RAILS_ENV=production bin/bundle exec rails assets:precompile
+ sudo -u $app RAILS_ENV=production bin/bundle exec rails db:migrate
+ sudo -u $app RAILS_ENV=production bin/tootctl cache clear
popd
#=================================================
@@ -295,7 +295,7 @@ yunohost service add "$app-streaming" --description "$app streaming service"
#=================================================
ynh_script_progression --message="Starting a systemd service..."
-ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on tcp"
+ynh_systemd_action --service_name=${app}-web --action="start" --log_path=systemd --line_match="Listening on"
ynh_systemd_action --service_name=${app}-sidekiq --action="start" --log_path=systemd --line_match="Schedules Loaded"
ynh_systemd_action --service_name=${app}-streaming --action="start" --log_path=systemd --line_match="Worker 1 now listening"