2020-05-17 15:53:04 +02:00
|
|
|
#!/bin/bash
|
|
|
|
pushd $final_path/diaspora
|
2022-03-02 09:13:11 +01:00
|
|
|
echo 2.6.6 > .ruby-version # overwrite 2.6 default from diaspora because rbenv does not understand it
|
2020-07-05 19:13:50 +02:00
|
|
|
sudo -u $app --login << EOF
|
|
|
|
gem install bundler:1.17.3
|
|
|
|
cd diaspora
|
2020-05-17 15:53:04 +02:00
|
|
|
script/configure_bundler
|
|
|
|
bin/bundle install --full-index --with=postgresql
|
|
|
|
EOF
|
2022-02-21 17:06:48 +01:00
|
|
|
# for some reason rake logs a lot in stderr (tried --quiet, didn't change anything)
|
|
|
|
# redirecting it to stdout to have a saner log on yunohost side
|
2022-03-02 09:12:56 +01:00
|
|
|
sudo -u $app /bin/bash -l << EOF
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
ynh_use_nodejs
|
2020-07-05 19:13:50 +02:00
|
|
|
cd diaspora
|
2022-02-21 17:06:48 +01:00
|
|
|
RAILS_ENV=production bundle exec rake db:migrate 2>&1
|
2020-05-17 15:53:04 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# ASSETS PRECOMPILATION
|
|
|
|
#=================================================
|
2022-02-21 17:06:48 +01:00
|
|
|
|
2022-03-02 09:12:56 +01:00
|
|
|
sudo -u $app /bin/bash << EOF
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
ynh_use_nodejs
|
2020-07-05 19:13:50 +02:00
|
|
|
cd diaspora
|
2022-02-21 17:06:48 +01:00
|
|
|
RAILS_ENV=production bin/rake assets:precompile 2>&1
|
2020-05-17 15:53:04 +02:00
|
|
|
EOF
|
|
|
|
popd
|
|
|
|
|