To setup the rails app, will be needed run active record migrations,
orient db migrations and populate active record database:
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
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 ```
### Test environment
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 ```
## Definitions
Some definitions and vocabulary of project domain model.
## Deploy
Before deploy to production server, some env vars need be set:
### Application Secrets
The command 'rake secret' can be used for generate random string
* SECRET_TOKEN
* SECRET_KEY_BASE
### Postgres/Active Record credentials
* PORTALMEC_DB_NAME
* PORTALMEC_DB_USERNAME
* PORTALMEC_DB_PASSWORD
### OrientDB credentials
* PORTALMEC_ORIENTDB_HOST
* PORTALMEC_ORIENTDB_DATABASE
* PORTALMEC_ORIENTDB_USERNAME
* PORTALMEC_ORIENTDB_PASSWD
* PORTALMEC_ORIENTDB_PORT
### Dspace credentials
* PORTALMEC_DSPACE_SOLR
* PORTALMEC_DSPACE_REST
* PORTALMEC_DSPACE_PORT
* PORTALMEC_DSPACE_HOST
### Rails environment
* RAILS_SERVE_STATIC_FILES - default is FALSE
* RAILS_ENV: production, test or development
Run:
```
$ mina setup
$ mina deploy
```
\ No newline at end of file
After the setup, link your webserver to the app. Some OS services are in root of the project and can be used.