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

Merge branch 'testing' into feature-ldap-config

This commit is contained in:
OniriCorpe 2024-02-24 21:55:55 +01:00 committed by GitHub
commit 5aff6637e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 147 additions and 196 deletions

View file

@ -1,5 +1,5 @@
<!-- <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
It shall NOT be edited by hand. It shall NOT be edited by hand.
--> -->
@ -29,6 +29,7 @@ Redmine is a flexible project management web application written using Ruby on R
* Official app website: <https://www.redmine.org> * Official app website: <https://www.redmine.org>
* Upstream app code repository: <https://github.com/redmine/redmine> * Upstream app code repository: <https://github.com/redmine/redmine>
* YunoHost Store: <https://apps.yunohost.org/app/redmine>
* Report a bug: <https://github.com/YunoHost-Apps/redmine_ynh/issues> * Report a bug: <https://github.com/YunoHost-Apps/redmine_ynh/issues>
## Developer info ## Developer info

View file

@ -1,5 +1,5 @@
<!-- <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
It shall NOT be edited by hand. It shall NOT be edited by hand.
--> -->
@ -29,6 +29,7 @@ Redmine est une application web de gestion de projet flexible écrite à l'aide
* Site officiel de lapp : <https://www.redmine.org> * Site officiel de lapp : <https://www.redmine.org>
* Dépôt de code officiel de lapp : <https://github.com/redmine/redmine> * Dépôt de code officiel de lapp : <https://github.com/redmine/redmine>
* YunoHost Store: <https://apps.yunohost.org/app/redmine>
* Signaler un bug : <https://github.com/YunoHost-Apps/redmine_ynh/issues> * Signaler un bug : <https://github.com/YunoHost-Apps/redmine_ynh/issues>
## Informations pour les développeurs ## Informations pour les développeurs

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2 packaging_format = 2
id = "redmine" id = "redmine"
@ -45,8 +47,36 @@ ram.runtime = "50M"
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"
[resources.ports]
main.default = 8095
[resources.apt] [resources.apt]
packages = "postgresql, libpq-dev" packages = [
"postgresql", "libpq-dev",
# For Ruby
"autoconf",
"build-essential",
"libdb-dev",
"libffi-dev",
"libgdbm-dev",
"libgdbm6",
"libgmp-dev",
"libjemalloc-dev",
"libncurses5-dev",
"libsqlite3-dev",
"libreadline6-dev",
"libssl-dev",
"libxml2-dev",
"libxslt-dev",
"libyaml-dev",
"patch",
"rustc",
"uuid-dev",
"zlib1g-dev",
"openssl",
]
[resources.database] [resources.database]
type = "postgresql" type = "postgresql"

View file

@ -4,12 +4,23 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
ruby_version=3.0 ruby_version=3.1
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================
_redmine_ruby_install() {
pushd "$install_dir"
ynh_use_ruby
"$ynh_gem" update --system --no-document
"$ynh_gem" install bundler passenger --no-document
bundle config set --local without 'development test rmagick'
bundle add 'webrick' --version '~> 1.7'
bundle install
popd
}
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================

View file

@ -22,24 +22,20 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir" ynh_backup --src_path="$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP VARIOUS FILES
#================================================= #=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/var/log/$app/"
#================================================= #=================================================
# BACKUP THE POSTGRESQL DATABASE # BACKUP THE POSTGRESQL DATABASE

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
@ -30,10 +30,10 @@ ynh_change_url_nginx_config
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting $app's systemd service..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="WEBrick::HTTPServer#start" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" --line_match="WEBrick::HTTPServer#start"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_script_progression --message="Installing Ruby..." --weight=1
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
@ -26,35 +26,23 @@ ynh_setup_source --dest_dir="$install_dir"
mkdir -p "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets" mkdir -p "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets"
chmod 750 "$install_dir"
chmod 755 "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_script_progression --message="Adding $app's configuration file..." --weight=1
ynh_add_config --template="../conf/database.example.yml" --destination="$install_dir/config/database.yml" ynh_add_config --template="database.example.yml" --destination="$install_dir/config/database.yml"
chmod 400 "$install_dir/config/database.yml" chmod 400 "$install_dir/config/database.yml"
chown $app:$app "$install_dir/config/database.yml" chown "$app:$app" "$install_dir/config/database.yml"
ynh_add_config --template="../conf/configuration.yml.example" --destination="$install_dir/config/configuration.yml" ynh_add_config --template="configuration.yml.example" --destination="$install_dir/config/configuration.yml"
chmod 400 "$install_dir/config/configuration.yml" chmod 400 "$install_dir/config/configuration.yml"
chown $app:$app "$install_dir/config/configuration.yml" chown "$app:$app" "$install_dir/config/configuration.yml"
ynh_add_config --template="db-ldap.sql" --destination="$install_dir/config/db-ldap.sql"
ynh_add_config --template="../conf/db-ldap.sql" --destination="$final_path/config/db-ldap.sql" ynh_add_config --template="../conf/db-ldap.sql" --destination="$final_path/config/db-ldap.sql"
@ -63,12 +51,9 @@ ynh_add_config --template="../conf/db-ldap.sql" --destination="$final_path/confi
#================================================= #=================================================
ynh_script_progression --message="Building app..." --weight=1 ynh_script_progression --message="Building app..." --weight=1
pushd $install_dir _redmine_ruby_install
ynh_use_ruby
ynh_gem update --system --no-document pushd "$install_dir"
ynh_gem install bundler passenger --no-document
bundle config set --local without 'development test rmagick'
bundle install
ynh_exec_warn_less bundle exec rake generate_secret_token RAILS_ENV=production ynh_exec_warn_less bundle exec rake generate_secret_token RAILS_ENV=production
ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production
@ -79,44 +64,33 @@ pushd $install_dir
#ynh_exec_warn_less bundle exec rake redmine:load_default_data RAILS_ENV=production #ynh_exec_warn_less bundle exec rake redmine:load_default_data RAILS_ENV=production
popd popd
chmod 750 "$install_dir/public" # Setting up LDAP authentification
chmod -R o-rwx "$install_dir/public" ynh_add_config --template="db-ldap.sql" --destination="$install_dir/config/db-ldap.sql"
chown -R $app:www-data "$install_dir/public" ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "$install_dir/config/db-ldap.sql"
ynh_secure_remove --file="$install_dir/config/db-ldap.sql"
#================================================= #=================================================
# SETUP SYSTEMD # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
yunohost service add "$app" --log="/var/log/$app/$app.log"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
mkdir -p "/var/log/$app"
chown -R $app:$app "/var/log/$app"
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting $app's systemd service..." --weight=1
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="WEBrick::HTTPServer#start" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" --line_match="WEBrick::HTTPServer#start"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -11,16 +11,13 @@ source ynh_install_ruby__2
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# STANDARD REMOVE # REMOVE SYSTEM CONFIGURATIONS
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
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`) # 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 >/dev/null if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
then yunohost service remove "$app"
ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app
fi fi
# Remove the dedicated systemd config # Remove the dedicated systemd config

View file

@ -11,6 +11,13 @@ source ../settings/scripts/_common.sh
source ../settings/scripts/ynh_install_ruby__2 source ../settings/scripts/ynh_install_ruby__2
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling Ruby..." --weight=1
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -21,87 +28,52 @@ ynh_restore_file --origin_path="$install_dir"
ynh_secure_remove --file="$install_dir/tmp" ynh_secure_remove --file="$install_dir/tmp"
mkdir -p "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets" mkdir -p "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# SPECIFIC RESTORATION # RESTORE THE POSTGRESQL DATABASE
#================================================= #=================================================
# REINSTALL DEPENDENCIES ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=1
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#================================================= #=================================================
# BUILD APP # BUILD APP
#================================================= #=================================================
ynh_script_progression --message="Building app..." --weight=1 ynh_script_progression --message="Building app..." --weight=1
pushd $install_dir _redmine_ruby_install
ynh_use_ruby
ynh_gem update --system --no-document
ynh_gem install bundler passenger --no-document
bundle config set --local without 'development test rmagick'
bundle install
popd
chmod 750 "$install_dir/public" chmod 750 "$install_dir/public"
chmod -R o-rwx "$install_dir/public" chmod -R o-rwx "$install_dir/public"
chown -R $app:www-data "$install_dir/public" chown -R "$app:www-data" "$install_dir/public"
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable "$app.service" --quiet
yunohost service add "$app" --log="/var/log/$app/$app.log"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
mkdir -p "/var/log/$app"
chown -R $app:$app "/var/log/$app"
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # RESTORE VARIOUS FILES
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log="/var/log/$app/$app.log" ynh_restore_file --origin_path="/var/log/$app/"
#================================================= #=================================================
# START SYSTEMD SERVICE # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="WEBrick::HTTPServer#start" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" --line_match="WEBrick::HTTPServer#start"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -10,54 +10,35 @@ source _common.sh
source ynh_install_ruby__2 source ynh_install_ruby__2
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping $app's systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config/database.yml config/configuration.yml"
fi
mkdir -p "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets"
chmod 750 "$install_dir"
chmod 755 "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_script_progression --message="Upgrading Ruby..." --weight=1
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
#================================================= #=================================================
# NGINX CONFIGURATION # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
# Create a dedicated NGINX config # Download, check integrity, uncompress and patch the source from app.src
ynh_add_nginx_config ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config/database.yml config/configuration.yml config/initializers/secret_token.rb"
mkdir -p "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets"
chmod 750 "$install_dir/files" "$install_dir/log" "$install_dir/tmp" "$install_dir/public/plugin_assets"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -66,56 +47,41 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Building app..." --weight=1 ynh_script_progression --message="Building app..." --weight=1
pushd $install_dir _redmine_ruby_install
ynh_use_ruby pushd "$install_dir"
ynh_gem update --system --no-document
ynh_gem install bundler passenger --no-document
bundle config set --local without 'development test rmagick'
bundle install
ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production ynh_exec_warn_less bundle exec rake db:migrate RAILS_ENV=production
popd popd
#Setting up LDAP authentification # Setting up LDAP authentification
ynh_psql_connect_as $db_user $db_pwd $db_name < $install_dir/config/db-ldap.sql ynh_add_config --template="db-ldap.sql" --destination="$install_dir/config/db-ldap.sql"
rm -f $install_dir/config/db-ldap.sql ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "$install_dir/config/db-ldap.sql"
ynh_secure_remove --file="$install_dir/config/db-ldap.sql"
chmod 750 "$install_dir/public" chmod 750 "$install_dir/public"
chmod -R o-rwx "$install_dir/public" chmod -R o-rwx "$install_dir/public"
chown -R $app:www-data "$install_dir/public" chown -R "$app:www-data" "$install_dir/public"
#================================================= #=================================================
# SETUP SYSTEMD # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
yunohost service add "$app" --log="/var/log/$app/$app.log"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
mkdir -p "/var/log/$app"
chown -R $app:$app "/var/log/$app"
# Use logrotate to manage app-specific logfile(s) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting $app's systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="WEBrick::HTTPServer#start" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" --line_match="WEBrick::HTTPServer#start"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -35,7 +35,7 @@ build_pkg_dependencies="$build_pkg_dependencies $build_ruby_dependencies"
# However, $PATH is duplicated into $ruby_path to outlast any manipulation of $PATH # However, $PATH is duplicated into $ruby_path to outlast any manipulation of $PATH
# You can use the variable `$ynh_ruby_load_path` to quickly load your Ruby version # You can use the variable `$ynh_ruby_load_path` to quickly load your Ruby version
# in $PATH for an usage into a separate script. # in $PATH for an usage into a separate script.
# Exemple: $ynh_ruby_load_path $final_path/script_that_use_gem.sh` # Exemple: $ynh_ruby_load_path $install_dir/script_that_use_gem.sh`
# #
# #
# Finally, to start a Ruby service with the correct version, 2 solutions # Finally, to start a Ruby service with the correct version, 2 solutions
@ -80,7 +80,7 @@ ynh_use_ruby () {
ynh_ruby_load_path="PATH=$PATH" ynh_ruby_load_path="PATH=$PATH"
# Sets the local application-specific Ruby version # Sets the local application-specific Ruby version
pushd $final_path pushd $install_dir
$rbenv_install_dir/bin/rbenv local $ruby_version $rbenv_install_dir/bin/rbenv local $ruby_version
popd popd
} }
@ -215,7 +215,8 @@ ynh_install_ruby () {
final_ruby_version=$ruby_version final_ruby_version=$ruby_version
fi fi
ynh_print_info --message="Installing Ruby-$final_ruby_version" ynh_print_info --message="Installing Ruby-$final_ruby_version"
CONFIGURE_OPTS="--disable-install-doc --with-jemalloc" MAKE_OPTS="-j2" rbenv install --skip-existing $final_ruby_version > /dev/null 2>&1 CONFIGURE_OPTS="--disable-install-doc --with-jemalloc" MAKE_OPTS="-j2" rbenv install --skip-existing $final_ruby_version
# > /dev/null 2>&1
# Store ruby_version into the config of this app # Store ruby_version into the config of this app
ynh_app_setting_set --app=$YNH_APP_INSTANCE_NAME --key=ruby_version --value=$final_ruby_version ynh_app_setting_set --app=$YNH_APP_INSTANCE_NAME --key=ruby_version --value=$final_ruby_version

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
test_format = 1.0 test_format = 1.0
[default] [default]