Skip to content
Snippets Groups Projects
Commit c0324299 authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Merge branch 'master' into update-learningobject-schema

parents 08f4c726 3a83d449
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,4 @@ test:
- gem install bundler
- bundle install
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake test
- bundle exec rake test
\ No newline at end of file
require 'yaml'
dspace_configs = YAML.load_file(Rails.root.join('config').to_s.concat('/dspace.yml'))
env_config = dspace_configs.fetch(Rails.env)
if Rails.env.production?
Dspace::Config.host = ENV['PORTALMEC_DSPACE_HOST']
Dspace::Config.port = ENV['PORTALMEC_DSPACE_PORT']
Dspace::Config.rest_webapp_name = ENV['PORTALMEC_DSPACE_REST_NAME']
Dspace::Config.solr_webapp_name = ENV['PORTALMEC_DSPACE_SOLR_NAME']
else
Dspace::Config.host = env_config['host']
Dspace::Config.port = env_config['port']
Dspace::Config.rest_webapp_name = env_config['rest_webapp_name']
Dspace::Config.solr_webapp_name = env_config['solr_webapp_name']
end
require 'yaml'
orientdb_configs = YAML.load_file Rails.root.join('config').to_s.concat('/orientdb.yml')
env_config = orientdb_configs.fetch(Rails.env)
if Rails.env.production?
OrientDb::Config.host = ENV['PORTALMEC_ORIENTDB_HOST']
OrientDb::Config.database = ENV['PORTALMEC_ORIENTDB_DATABASE']
OrientDb::Config.user = ENV['PORTALMEC_ORIENTDB_USERNAME']
OrientDb::Config.password = ENV['PORTALMEC_ORIENTDB_PASSWD']
OrientDb::Config.port = ENV['PORTALMEC_ORIENTDB_PORT']
else
OrientDb::Config.host = env_config['host']
OrientDb::Config.database = env_config['database']
OrientDb::Config.user = env_config['username']
OrientDb::Config.password = env_config['password']
end
\ No newline at end of file
require 'yaml'
dspace_configs = YAML.load_file(Rails.root.join('config').to_s.concat('/dspace.yml'))
env_config = dspace_configs.fetch(Rails.env)
Dspace::Config.host = env_config['host']
Dspace::Config.port = env_config['port']
Dspace::Config.rest_webapp_name = env_config['rest_webapp_name']
Dspace::Config.solr_webapp_name = env_config['solr_webapp_name']
\ No newline at end of file
require 'yaml'
# connect to orientdb server
orientdb_configs = YAML.load_file Rails.root.join('config').to_s.concat('/orientdb.yml')
env_config = orientdb_configs.fetch(Rails.env)
OrientDb::Config.host = env_config['host']
OrientDb::Config.database = env_config['database']
OrientDb::Config.user = env_config['username']
OrientDb::Config.password = env_config['password']
Repository::Environments.create :development do |repository|
repository.register :learning_object, OrientDb::LearningObjectRepository.new(OrientDb::Client.instance)
repository.register :mainPage, OrientDb::MainPageRepository.new(OrientDb::Client.instance)
......
development: &development
host: mecdb2.c3sl.ufpr.br
database: PortalMEC
host: localhost
database: portalmec
username: admin
password: admin
port: 2480
......
......@@ -9,6 +9,7 @@ class OrientDb::Client
begin
@@client = Orientdb4r.client :host => OrientDb::Config::host, :port => OrientDb::Config::port, :ssl => OrientDb::Config::ssl
@@client.connect(database: OrientDb::Config::database, user: OrientDb::Config::user, password: OrientDb::Config::password)
@@client
rescue Orientdb4r::UnauthorizedError => e
raise 'Wrong orient db credentials'
end
......
......@@ -9,6 +9,7 @@ class OrientDb::Migrations
@migrations << CreateHighlight.new(client)
@migrations << CreateUniversity.new(client)
@migrations << CreateUser.new(client)
@migrations << CreateMainpage.new(client)
end
##
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment