diff --git a/scripts/restore b/scripts/restore index 4e39f48..519f2aa 100755 --- a/scripts/restore +++ b/scripts/restore @@ -100,11 +100,29 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_extra_app_dependencies --repo="deb https://artifacts.elastic.co/packages/8.x/apt stable main" --package="elasticsearch" --key="https://artifacts.elastic.co/GPG-KEY-elasticsearch" +#================================================= +# BUILD APP +#================================================= +ynh_script_progression --message="Building app..." + +pushd $final_path + ynh_use_ruby + ynh_exec_warn_less $ynh_gem install bundler + ynh_exec_warn_less bin/bundle config --global frozen 1 + ynh_exec_warn_less bin/bundle config set --local without 'development test doc' + ynh_exec_warn_less bin/bundle install --binstubs + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cache clean + ynh_exec_warn_less ynh_exec_as $app env RAILS_ENV=production RACK_ENV=production $ynh_ruby_load_path bin/bundle exec rake db:migrate + ynh_exec_warn_less ynh_exec_as $app env RAILS_ENV=production RACK_ENV=production $ynh_ruby_load_path bin/bundle exec rake db:seed ADMIN_EMAIL="$admin_mail" ADMIN_PASSWORD="$password" + ynh_exec_warn_less ynh_exec_as $app env RAILS_ENV=production RACK_ENV=production $ynh_ruby_load_path bin/bundle exec rake assets:precompile + ynh_exec_warn_less ynh_exec_as $app env RAILS_ENV=production RACK_ENV=production $ynh_ruby_load_path bin/bundle exec rake fablab:es:build_stats +popd + ynh_install_app_dependencies $pkg_dependencies ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" ynh_install_extra_app_dependencies --repo="deb https://artifacts.elastic.co/packages/8.x/apt stable main" --package="elasticsearch" --key="https://artifacts.elastic.co/GPG-KEY-elasticsearch" -ynh_use_ruby -ynh_use_nodejs #================================================= # RESTORE THE POSTGRESQL DATABASE