mirror of
https://github.com/YunoHost-Apps/redmine_ynh.git
synced 2024-09-03 20:16:16 +02:00
Fix
This commit is contained in:
parent
28cb29f8d6
commit
0207126bd2
2 changed files with 19 additions and 5 deletions
|
@ -19,6 +19,19 @@ BUNDLER_VERSION="2.2.3"
|
|||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
# Execute a command as another user
|
||||
# usage: ynh_exec_as USER COMMAND [ARG ...]
|
||||
ynh_exec_as() {
|
||||
local USER=$1
|
||||
shift 1
|
||||
|
||||
if [[ $USER = $(whoami) ]]; then
|
||||
eval "$@"
|
||||
else
|
||||
sudo -u "$USER" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -76,8 +76,6 @@ ynh_script_progression --message="Installing Rails & Bunlder..." --time --weight
|
|||
|
||||
ynh_install_ruby --ruby_version=$RUBY_VERSION
|
||||
|
||||
gem install bundler
|
||||
|
||||
#=================================================
|
||||
# CREATE A POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
|
@ -133,9 +131,11 @@ cp -a ../conf/configuration.example.yml $final_path/config/configuration.yml
|
|||
ynh_print_info "Compile Redmine..."
|
||||
|
||||
pushd $final_path
|
||||
bundle install --without development test rmagick
|
||||
RAILS_ENV=production bin/rake generate_secret_token
|
||||
RAILS_ENV=production bin/rake db:migrate
|
||||
gem install bundler
|
||||
ynh_exec_as $app bundle install --without development test --path vendor/bundle
|
||||
ynh_exec_as $app bundle exec rake generate_secret_token
|
||||
ynh_exec_as $app RAILS_ENV=production bundle exec rake db:migrate
|
||||
ynh_exec_as $app RAILS_ENV=production REDMINE_LANG=en bundle exec rake redmine:load_default_data
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
|
@ -160,6 +160,7 @@ ynh_add_nginx_config
|
|||
|
||||
# Set permissions to app files
|
||||
chown -R $app:$app $final_path
|
||||
chmod -R 755 $final_path
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
|
Loading…
Add table
Reference in a new issue