Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
refactor config file rake tasks; fix an error with "set" object not d…
Browse files Browse the repository at this point in the history
…efined as a valid fedora type when these objects exist in production
  • Loading branch information
peetucket committed Nov 7, 2014
1 parent eb1bc06 commit 748d376
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ end

group :development, :test do
gem 'jettywrapper'
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
gem 'launchy'
gem 'thin'
end


Expand Down
28 changes: 28 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ GEM
addressable (2.3.6)
arel (5.0.1.20140414130214)
awesome_print (1.2.0)
better_errors (2.0.0)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
bundler-audit (0.3.1)
bundler (~> 1.2)
thor (~> 0.18)
callsite (0.0.11)
capistrano (3.2.1)
i18n
rake (>= 10.0.0)
Expand Down Expand Up @@ -62,6 +69,7 @@ GEM
xpath (~> 2.0)
childprocess (0.5.5)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
Expand All @@ -78,9 +86,12 @@ GEM
thor
crack (0.4.2)
safe_yaml (~> 1.0.0)
daemons (1.1.9)
debug_inspector (0.0.2)
diff-lcs (1.2.5)
docile (1.1.5)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (2.2.2)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
Expand All @@ -100,6 +111,8 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
launchy (2.4.2)
addressable (~> 2.3)
libv8 (3.16.14.7)
logger (1.2.8)
lyberteam-capistrano-devel (3.1.0)
Expand All @@ -109,6 +122,10 @@ GEM
capistrano-releaseboard
mail (2.6.3)
mime-types (>= 1.16, < 3)
meta_request (0.3.4)
callsite (~> 0.0, >= 0.0.11)
rack-contrib (~> 1.1)
railties (>= 3.0.0, < 5.0.0)
mime-types (2.4.3)
mini_portile (0.6.0)
minitest (5.4.2)
Expand All @@ -122,6 +139,8 @@ GEM
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
rack (1.5.2)
rack-contrib (1.1.0)
rack (>= 0.9.1)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.1.7)
Expand Down Expand Up @@ -200,6 +219,10 @@ GEM
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
thin (1.6.2)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
Expand All @@ -224,6 +247,8 @@ PLATFORMS

DEPENDENCIES
awesome_print
better_errors
binding_of_caller
capistrano (~> 3.0)
capistrano-bundler
capistrano-rails
Expand All @@ -235,7 +260,9 @@ DEPENDENCIES
jbuilder (~> 2.0)
jettywrapper
jquery-rails
launchy
lyberteam-capistrano-devel
meta_request
mysql
rails (>= 4.1.6)
rest_client
Expand All @@ -245,6 +272,7 @@ DEPENDENCIES
sdoc (~> 0.4.0)
sqlite3
therubyracer
thin
turbolinks
uglifier (>= 1.3.0)
vcr
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Application < Rails::Application
Last_Changed_Field = Solr_terms['last_changed']
Fedora_Prefix = Solr_terms['fedora_prefix']
Druid_Prefix = Solr_terms['druid_prefix']
Fedora_Types = {:collection =>Solr_terms['collection_type'], :apo =>Solr_terms['apo_type'], :item=>Solr_terms['item_type']}
Fedora_Types = {:collection =>Solr_terms['collection_type'], :apo =>Solr_terms['apo_type'], :item=>Solr_terms['item_type'], :set=>Solr_terms['set_type']}
Controller_Types = {:collection => Solr_terms['collection_field'], :apo=>Solr_terms['apo_field'], :tag=> Solr_terms['tag_field']}
rescue
puts 'WARNING: Could not configure solr terms'
Expand Down
1 change: 1 addition & 0 deletions config/solr_terms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defaults: &defaults
tag_field: "tag_facet"
id_field: "id"
collection_type: "collection"
set_type: "set"
apo_type: "adminpolicy"
fedora_type_field: "identityMetadata_objectType_t"
druid_prefix: "druid:"
Expand Down
13 changes: 9 additions & 4 deletions lib/tasks/ci.rake
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ end

namespace :dorfetcher do

desc "Copy configuration files"
desc "Copy just shared yml files"
task :config_yml do
cp("#{Rails.root}/config/database.yml.example", "#{Rails.root}/config/database.yml") unless File.exists?("#{Rails.root}/config/database.yml")
cp("#{Rails.root}/config/solr.yml.example", "#{Rails.root}/config/solr.yml") unless File.exists?("#{Rails.root}/config/solr.yml")
cp("#{Rails.root}/config/secrets.yml.example", "#{Rails.root}/config/secrets.yml") unless File.exists?("#{Rails.root}/config/secrets.yml")
end

desc "Copy all configuration files"
task :config do
Rake::Task["jetty:stop"].invoke
Rake::Task["dorfetcher:config_yml"].invoke
system('rm -fr jetty/solr/dev/data/index')
system('rm -fr jetty/solr/test/data/index')
cp("#{Rails.root}/config/database.yml.example", "#{Rails.root}/config/database.yml") unless File.exists?("#{Rails.root}/config/database.yml")
cp("#{Rails.root}/config/solr.yml.example", "#{Rails.root}/config/solr.yml") unless File.exists?("#{Rails.root}/config/solr.yml")
cp("#{Rails.root}/config/secrets.yml.example", "#{Rails.root}/config/secrets.yml") unless File.exists?("#{Rails.root}/config/secrets.yml")
cp("#{Rails.root}/config/schema.xml", "#{Rails.root}/jetty/solr/dev/conf/schema.xml")
cp("#{Rails.root}/config/schema.xml", "#{Rails.root}/jetty/solr/test/conf/schema.xml")
cp("#{Rails.root}/config/solrconfig.xml", "#{Rails.root}/jetty/solr/dev/conf/solrconfig.xml")
Expand Down
5 changes: 2 additions & 3 deletions lib/tasks/travis.rake
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
require 'jettywrapper' unless Rails.env.production? or Rails.env.development?
require 'rest_client'

desc "Set up default database.yml for Travis and run the tests."
desc "Set up default .yml config files for Travis and run the tests."
task :travis_spec do
`cp config/database.yml.example config/database.yml`
`cp config/solr.yml.example config/solr.yml`
Rake::Task["dorfetcher:config_yml"].invoke
Rake::Task['rspec'].invoke
end

0 comments on commit 748d376

Please sign in to comment.