Skip to content
Snippets Groups Projects
Forked from PortalMEC / portalmec
Source project has a limited visibility.

Portal MEC

Requirements

  • ruby >=2.2
  • rvm
  • Dspace server
  • Postgres >=9.4
  • Elasticsearch
  • Redis

Setup

First of all, you need configure the dspace, elasticsearch and redis servers. An user for postgres database will be needed to. After this setup, open the config files and update some vars:

* config/database.yml: change your postgres credentials for development and test environment.
* config/dspace.yml: change your dspace host and credentials for development and test environment.
* config/sidekiq.yml: change your redis hosts and ports.
* config/initializers/gitlab.rb: change your gitlab host for bug reports and set env var with private token. ( $ export GITLAB_PORTALMEC_PRIVATE_TOKEN=131237128937128937 )

Development environment

#### Using docker for development env
You can use docker for your development environment. For that, run:
``` ./bin/docker-setup ```
Now, redis, elasticsearch and postgres are running as services and linked to PortalMEC application. Database migrations were execute and the configs (database.yml, sidekiq.yml was replaced by config/docker/...).

If all development and test vars are set, run: ./bin/setup This command will install the rubygems, create/reset your database schema, seed some default data and import all dspace data.

After this, your application is ready to use and you can access it with: bundle exec rails s

Running tests suite

For tests, TestUnit is used, and to run it: bundle exec rake test

Production environment

As you set development and test environment vars, now production vars will be needed to be set. For that, open the file config/env_vars.sh and set them. After, run: ./config/env_vars.sh

* Redis vars need to be set on config/sidekiq.yml
* In config/initializers/devise.rb, change the emails addresses. (Ex.: config.mailer_sender = 'suporte@c3sl.ufpr.br')

Now, you can run and your application is ready to use: ./bin/setup

After the setup, link your webserver to the app. Some OS services are in root of the project and can be used.