mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
Remove ynh_exec_warn_less
This commit is contained in:
parent
26a123975b
commit
dffe0ec1a7
4 changed files with 23 additions and 19 deletions
|
@ -62,10 +62,10 @@ ynh_app_setting_set --app="$app" --key=active_record_encryption_key_derivation_s
|
|||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing Ruby..." --weight=1
|
||||
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
|
||||
ynh_install_ruby --ruby_version=$ruby_version 2>&1
|
||||
|
||||
ynh_script_progression --message="Installing NodeJS..." --weight=1
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
ynh_install_nodejs --nodejs_version=$nodejs_version 2>&1
|
||||
|
||||
#=================================================
|
||||
# ADD SWAP IF NEEDED
|
||||
|
@ -140,12 +140,12 @@ pushd "$install_dir/live"
|
|||
# This export might be removed in yunohost 12
|
||||
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install
|
||||
echo "SAFETY_ASSURED=1">> "$config"
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate --quiet
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:precompile --quiet
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate --quiet 2>&1
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:precompile --quiet 2>&1
|
||||
# Generate vapid keys
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt 2>&1
|
||||
# Create the first admin user
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=Owner > /dev/null
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=Owner > /dev/null 2>&1
|
||||
popd
|
||||
|
||||
# Re-generate config with vapid keys
|
||||
|
|
|
@ -13,15 +13,15 @@ source /usr/share/yunohost/helpers
|
|||
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
|
||||
|
||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
||||
if ynh_exec_warn_less yunohost service status "$app-web" >/dev/null; then
|
||||
if yunohost service status "$app-web" >/dev/null 2>&1; then
|
||||
yunohost service remove "$app-web"
|
||||
fi
|
||||
|
||||
if ynh_exec_warn_less yunohost service status "$app-sidekiq" >/dev/null; then
|
||||
if yunohost service status "$app-sidekiq" >/dev/null 2>&1; then
|
||||
yunohost service remove "$app-sidekiq"
|
||||
fi
|
||||
|
||||
if ynh_exec_warn_less yunohost service status "$app-streaming" >/dev/null; then
|
||||
if yunohost service status "$app-streaming" >/dev/null 2>&1; then
|
||||
yunohost service remove "$app-streaming"
|
||||
fi
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@ source /usr/share/yunohost/helpers
|
|||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling Ruby..." --weight=1
|
||||
ynh_exec_warn_less ynh_install_ruby --ruby_version="$ruby_version"
|
||||
ynh_install_ruby --ruby_version="$ruby_version" 2>&1
|
||||
|
||||
ynh_script_progression --message="Reinstalling NodeJS..." --weight=1
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
|
||||
ynh_install_nodejs --nodejs_version="$nodejs_version" 2>&1
|
||||
|
||||
#=================================================
|
||||
# ADD SWAP IF NEEDED
|
||||
|
|
|
@ -70,10 +70,10 @@ ynh_add_swap --size=$swap_needed
|
|||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading Ruby..." --weight=1
|
||||
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
|
||||
ynh_install_ruby --ruby_version=$ruby_version 2>&1
|
||||
|
||||
ynh_script_progression --message="Upgrading NodeJS..." --weight=1
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
ynh_install_nodejs --nodejs_version=$nodejs_version 2>&1
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -104,6 +104,7 @@ chown "$app:$app" "$config"
|
|||
ynh_script_progression --message="Building assets..." --weight=1
|
||||
|
||||
pushd "$install_dir/live"
|
||||
{
|
||||
ynh_use_ruby
|
||||
ynh_gem update --system
|
||||
ynh_gem install bundler --no-document
|
||||
|
@ -117,11 +118,12 @@ pushd "$install_dir/live"
|
|||
corepack enable
|
||||
yarn install
|
||||
if [ -d "$install_dir/live/public/assets" ]; then
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:clean
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:clean 2>&1
|
||||
fi
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:precompile
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/tootctl cache clear
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails assets:precompile 2>&1
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate 2>&1
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/tootctl cache clear 2>&1
|
||||
}
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
@ -130,9 +132,11 @@ popd
|
|||
ynh_script_progression --message="Applying migrations..." --weight=1
|
||||
|
||||
pushd "$install_dir/live"
|
||||
{
|
||||
ynh_use_ruby
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate
|
||||
ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/tootctl cache clear
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/bundle exec rails db:migrate 2>&1
|
||||
ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" $ld_preload bin/tootctl cache clear 2>&1
|
||||
}
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue