mirror of
https://github.com/YunoHost-Apps/redmine_ynh.git
synced 2024-09-03 20:16:16 +02:00
commit
7589220521
5 changed files with 17 additions and 48 deletions
|
@ -5,7 +5,7 @@
|
||||||
is_public=1
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=1
|
setup_sub_dir=0
|
||||||
setup_root=1
|
setup_root=1
|
||||||
setup_nourl=0
|
setup_nourl=0
|
||||||
setup_private=1
|
setup_private=1
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
"id": "redmine",
|
"id": "redmine",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"description": {
|
"description": {
|
||||||
"en": "A flexible project management web application.",
|
"en": "Flexible project management web application",
|
||||||
"fr": "Un gestionnaire de projet flexible sous forme d'application web."
|
"fr": "Gestionnaire de projet flexible sous forme d'application web"
|
||||||
},
|
},
|
||||||
"version": "4.2.4~ynh2",
|
"version": "4.2.4~ynh2",
|
||||||
"url": "https://www.redmine.org/",
|
"url": "https://www.redmine.org/",
|
||||||
|
@ -32,12 +32,6 @@
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain"
|
"type": "domain"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "path",
|
|
||||||
"example": "/red",
|
|
||||||
"default": "/red"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|
|
@ -25,7 +25,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url="/"
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -65,8 +65,8 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..."
|
ynh_script_progression --message="Installing dependencies..."
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
|
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
|
||||||
ynh_install_ruby --ruby_version=$ruby_version
|
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -120,12 +120,10 @@ ynh_add_nginx_config
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
ynh_script_progression --message="Adding a configuration file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/database.example.yml" --destination="$final_path/config/database.yml"
|
ynh_add_config --template="../conf/database.example.yml" --destination="$final_path/config/database.yml"
|
||||||
|
|
||||||
chmod 400 "$final_path/config/database.yml"
|
chmod 400 "$final_path/config/database.yml"
|
||||||
chown $app:$app "$final_path/config/database.yml"
|
chown $app:$app "$final_path/config/database.yml"
|
||||||
|
|
||||||
ynh_add_config --template="../conf/configuration.yml.example" --destination="$final_path/config/configuration.yml"
|
ynh_add_config --template="../conf/configuration.yml.example" --destination="$final_path/config/configuration.yml"
|
||||||
|
|
||||||
chmod 400 "$final_path/config/configuration.yml"
|
chmod 400 "$final_path/config/configuration.yml"
|
||||||
chown $app:$app "$final_path/config/configuration.yml"
|
chown $app:$app "$final_path/config/configuration.yml"
|
||||||
|
|
||||||
|
@ -138,15 +136,14 @@ pushd $final_path
|
||||||
ynh_use_ruby
|
ynh_use_ruby
|
||||||
ynh_gem update --system --no-document
|
ynh_gem update --system --no-document
|
||||||
ynh_gem install bundler passenger --no-document
|
ynh_gem install bundler passenger --no-document
|
||||||
bundle config set --local without 'development test'
|
bundle config set --local without 'development test rmagick'
|
||||||
bundle install
|
bundle install
|
||||||
bundle install --without development test rmagick
|
|
||||||
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
|
||||||
#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
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
chmod 750 "$final_path/public"
|
chmod 750 "$final_path/public"
|
||||||
chmod -R o-rwx "$final_path/public"
|
chmod -R o-rwx "$final_path/public"
|
||||||
|
|
|
@ -78,8 +78,8 @@ chown -R $app:www-data "$final_path"
|
||||||
ynh_script_progression --message="Reinstalling dependencies..."
|
ynh_script_progression --message="Reinstalling dependencies..."
|
||||||
|
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
|
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
|
||||||
ynh_install_ruby --ruby_version=$ruby_version
|
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE POSTGRESQL DATABASE
|
# RESTORE THE POSTGRESQL DATABASE
|
||||||
|
@ -91,8 +91,6 @@ ynh_psql_test_if_first_run
|
||||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||||
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD APP
|
# BUILD APP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -102,12 +100,11 @@ pushd $final_path
|
||||||
ynh_use_ruby
|
ynh_use_ruby
|
||||||
ynh_gem update --system --no-document
|
ynh_gem update --system --no-document
|
||||||
ynh_gem install bundler passenger --no-document
|
ynh_gem install bundler passenger --no-document
|
||||||
bundle config set --local without 'development test'
|
bundle config set --local without 'development test rmagick'
|
||||||
bundle install
|
bundle install
|
||||||
bundle install --without development test rmagick
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
chmod 750 "$final_path/public"
|
chmod 750 "$final_path/public"
|
||||||
chmod -R o-rwx "$final_path/public"
|
chmod -R o-rwx "$final_path/public"
|
||||||
|
|
|
@ -65,7 +65,6 @@ ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
# Cleaning legacy permissions
|
# Cleaning legacy permissions
|
||||||
if ynh_legacy_permissions_exists; then
|
if ynh_legacy_permissions_exists; then
|
||||||
ynh_legacy_permissions_delete_all
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -86,7 +85,7 @@ then
|
||||||
ynh_script_progression --message="Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/database.yml $final_path/config/configuration.yml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$final_path/files" "$final_path/log" "$final_path/tmp" "$final_path/public/plugin_assets"
|
mkdir -p "$final_path/files" "$final_path/log" "$final_path/tmp" "$final_path/public/plugin_assets"
|
||||||
|
@ -109,25 +108,8 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading dependencies..."
|
ynh_script_progression --message="Upgrading dependencies..."
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
|
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $build_pkg_dependencies
|
||||||
ynh_install_ruby --ruby_version=$ruby_version
|
ynh_exec_warn_less ynh_install_ruby --ruby_version=$ruby_version
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPGRADE
|
|
||||||
#=================================================
|
|
||||||
# ADD A CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
|
||||||
|
|
||||||
ynh_add_config --template="../conf/database.example.yml" --destination="$final_path/config/database.yml"
|
|
||||||
|
|
||||||
chmod 400 "$final_path/config/database.yml"
|
|
||||||
chown $app:$app "$final_path/config/database.yml"
|
|
||||||
|
|
||||||
ynh_add_config --template="../conf/configuration.yml.example" --destination="$final_path/config/configuration.yml"
|
|
||||||
|
|
||||||
chmod 400 "$final_path/config/configuration.yml"
|
|
||||||
chown $app:$app "$final_path/config/configuration.yml"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD APP
|
# BUILD APP
|
||||||
|
@ -138,13 +120,12 @@ pushd $final_path
|
||||||
ynh_use_ruby
|
ynh_use_ruby
|
||||||
ynh_gem update --system --no-document
|
ynh_gem update --system --no-document
|
||||||
ynh_gem install bundler passenger --no-document
|
ynh_gem install bundler passenger --no-document
|
||||||
bundle config set --local without 'development test'
|
bundle config set --local without 'development test rmagick'
|
||||||
bundle install
|
bundle install
|
||||||
bundle install --without development test rmagick
|
|
||||||
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
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
chmod 750 "$final_path/public"
|
chmod 750 "$final_path/public"
|
||||||
chmod -R o-rwx "$final_path/public"
|
chmod -R o-rwx "$final_path/public"
|
||||||
|
|
Loading…
Add table
Reference in a new issue