Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Changes needed for deploying to demoable host
Browse files Browse the repository at this point in the history
* Updates preservation gem.

* Adds gem therubyracer.

* Do not load  rake tasks for 'dev' and 'test' environments when in production.

* Applies patch for active_fedora-noid. This is a tmp measure for getting
  curation_concerns 1.6.3 to run in production without having to upgrade to
  1.7.x yet. See samvera-deprecated/curation_concerns#1061.

* Adds config for 'production' enviornment in config/role_map.yml. Without
  some config for 'production' env, we get errors from hydra-access-controls.

* Add solr_wrapper and fcrepo_wrapper to bundle (not just :development and
  :test groups). Also adds config for both in .solr_wrapper.production and
  .fcrepo_wrapper.production.

  NOTE: We're going to use them in production to get a demo up quickly. We will
  want to come back to this when building out a more robust production env.

* Adds results of running Preservation gem install generator.

* StorageControllerBehavior Module is defined without a namespace, but was
  trying to be included with `HydraDAM::StorageControllerBehavior`.

* Removes `require 'pry'` everywhere. It's not part of the production bundle.
  Require it in development as needed, but please don't commit it.

Closes HDM-800.
  • Loading branch information
afred committed Mar 1, 2017
1 parent f006b47 commit 3a857bf
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 66 deletions.
3 changes: 3 additions & 0 deletions .fcrepo_wrapper.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place any default configuration for solr_wrapper here
port: 8984
enable_jms: false
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
!/log/.keep
/tmp

/jetty
/fcrepo4-data

/coverage/
.coveralls.yml

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.1
2.3.0
5 changes: 5 additions & 0 deletions .solr_wrapper.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Place any default configuration for solr_wrapper here
# port: 8983
collection:
dir: solr/config/
name: phydo-production
20 changes: 15 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use sqlite3 as the database for Active Record
Expand All @@ -12,7 +11,7 @@ gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
Expand Down Expand Up @@ -53,8 +52,6 @@ group :development do
end

group :development, :test do
gem 'solr_wrapper', '0.18.0'
gem 'fcrepo_wrapper'
gem 'rspec-rails'
gem 'capybara'
gem 'webmock'
Expand All @@ -68,4 +65,17 @@ gem 'devise-guests', '~> 0.3'
gem 'omniauth-cas'
gem 'archive-tar-minitar', '~> 0.5.2'
gem 'blacklight_range_limit', github: 'projectblacklight/blacklight_range_limit', branch: 'master'
gem 'preservation', github: 'WGBH/hydradam-preservation', branch: 'master'
gem 'preservation', github: 'WGBH/hydradam-preservation', branch: 'HDM-843_smarter_rake_task_loading'

# TODO
# This is part of a back port of a patch introduced in curation_concerns ~>
# 1.7.x. This should not be required after upgrading to cuation_concerns ~>
# 1.7.x. See https://github.com/projecthydra/curation_concerns/pull/1061/files
gem 'active_fedora-noid', '~> 2.0.0-beta5'


# TODO
# These are added as a convenient way to get Solr and Fedora running on a demo.
# Do we want to run these in production, or have something more robust?
gem 'solr_wrapper'
gem 'fcrepo_wrapper'
67 changes: 39 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: git://github.com/WGBH/hydradam-preservation.git
revision: 6c9f8143f55e689c0cf8539ba0f6230cf52edfd2
branch: master
revision: b4eb59ce7cfbaec04a42808031246c5938e33350
branch: HDM-843_smarter_rake_task_loading
specs:
preservation (0.1.0)
curation_concerns (~> 1.6.3)
Expand Down Expand Up @@ -44,14 +44,14 @@ GEM
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
active-fedora (11.1.2)
active-fedora (11.1.4)
active-triples (~> 0.11.0)
activemodel (>= 4.2, < 6)
activesupport (>= 4.2.4, < 6)
deprecation
ldp (~> 0.6.0)
rsolr (>= 1.1.2, < 3)
solrizer (~> 3.4)
solrizer (>= 3.4, < 5)
active-triples (0.11.0)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
Expand All @@ -60,7 +60,7 @@ GEM
active_attr (0.10.0)
activemodel (>= 3.0.2, < 5.1)
activesupport (>= 3.0.2, < 5.1)
active_fedora-noid (2.0.1)
active_fedora-noid (2.0.0)
active-fedora (>= 9.7, < 12)
noid (~> 0.9)
rails (>= 4.2.7.1, < 6)
Expand All @@ -86,17 +86,17 @@ GEM
rails (>= 4.2, < 6)
archive-tar-minitar (0.5.2)
arel (7.1.4)
autoprefixer-rails (6.7.2)
autoprefixer-rails (6.7.3)
execjs
awesome_nested_set (3.1.1)
activerecord (>= 4.0.0, < 5.1)
aws-sdk (2.7.4)
aws-sdk-resources (= 2.7.4)
aws-sdk-core (2.7.4)
aws-sdk (2.7.9)
aws-sdk-resources (= 2.7.9)
aws-sdk-core (2.7.9)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.7.4)
aws-sdk-core (= 2.7.4)
aws-sdk-resources (2.7.9)
aws-sdk-core (= 2.7.9)
aws-sigv4 (1.0.0)
babel-source (5.8.35)
babel-transpiler (0.7.0)
Expand Down Expand Up @@ -142,7 +142,7 @@ GEM
skydrive
builder (3.2.3)
byebug (9.0.6)
cancancan (1.15.0)
cancancan (1.16.0)
capybara (2.12.0)
addressable
mime-types (>= 1.16)
Expand All @@ -159,7 +159,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.4)
concurrent-ruby (1.0.5)
coveralls (0.8.19)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
Expand Down Expand Up @@ -193,6 +193,8 @@ GEM
sprockets-es6
daemons (1.2.4)
debug_inspector (0.0.2)
declarative (0.0.9)
declarative-option (0.1.0)
deprecation (1.0.0)
activesupport
devise (4.2.0)
Expand Down Expand Up @@ -220,15 +222,15 @@ GEM
railties (>= 3.2, < 5.1)
globalid (0.3.7)
activesupport (>= 4.1.0)
google-api-client (0.9.26)
google-api-client (0.10.0)
addressable (~> 2.3)
googleauth (~> 0.5)
httpclient (~> 2.7)
hurley (~> 0.1)
memoist (~> 0.11)
mime-types (>= 1.6)
representable (~> 2.3.0)
retriable (~> 2.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
google_drive (2.1.2)
google-api-client (>= 0.9.0, < 1.0.0)
googleauth (>= 0.5.0, < 1.0.0)
Expand Down Expand Up @@ -291,7 +293,7 @@ GEM
hydra-file_characterization (~> 0.3, >= 0.3.3)
hydra-pcdm (>= 0.9)
om (~> 3.1)
i18n (0.8.0)
i18n (0.8.1)
jbuilder (2.6.1)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
Expand All @@ -312,7 +314,7 @@ GEM
activesupport (>= 3.0.0)
kaminari_route_prefix (0.0.2)
kaminari (~> 0.16)
ldp (0.6.3)
ldp (0.6.4)
deprecation
faraday
http_logger
Expand All @@ -322,6 +324,7 @@ GEM
rdf-turtle
rdf-vocab (>= 0.8)
slop
libv8 (3.16.14.17)
link_header (0.0.8)
little-plugger (1.1.4)
logging (2.1.0)
Expand All @@ -337,7 +340,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_magick (4.6.0)
mini_magick (4.6.1)
mini_portile2 (2.1.0)
minitest (5.10.1)
multi_json (1.12.1)
Expand Down Expand Up @@ -428,11 +431,14 @@ GEM
redis (3.3.3)
redlock (0.1.8)
redis (~> 3, >= 3.0.0)
representable (2.3.0)
uber (~> 0.0.7)
ref (2.0.0)
representable (3.0.3)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
retriable (2.1.0)
retriable (3.0.0)
rsolr (1.1.2)
builder (>= 2.1.2)
rspec (3.5.0)
Expand Down Expand Up @@ -462,7 +468,7 @@ GEM
multipart-post
oauth2
ruby-progressbar (1.8.1)
rubyzip (1.2.0)
rubyzip (1.2.1)
safe_yaml (1.0.4)
sass (3.4.23)
sass-rails (5.0.6)
Expand Down Expand Up @@ -493,7 +499,7 @@ GEM
httparty (>= 0.11.0)
oauth2 (>= 0.9.2)
slop (3.6.0)
solr_wrapper (0.18.0)
solr_wrapper (0.21.0)
faraday
ruby-progressbar
rubyzip
Expand Down Expand Up @@ -522,8 +528,11 @@ GEM
rdf (~> 2.0)
term-ansicolor (1.4.0)
tins (~> 1.0)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
thor (0.19.4)
thread_safe (0.3.5)
thread_safe (0.3.6)
tilt (2.0.6)
tins (1.13.2)
turbolinks (5.0.1)
Expand All @@ -535,7 +544,7 @@ GEM
railties (>= 3.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uber (0.0.15)
uber (0.1.0)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
warden (1.2.7)
Expand All @@ -560,6 +569,7 @@ PLATFORMS
ruby

DEPENDENCIES
active_fedora-noid (~> 2.0.0.pre.beta5)
archive-tar-minitar (~> 0.5.2)
blacklight_range_limit!
byebug
Expand All @@ -583,13 +593,14 @@ DEPENDENCIES
rspec-rails
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
solr_wrapper (= 0.18.0)
solr_wrapper
spring
sqlite3
therubyracer
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)
webmock

BUNDLED WITH
1.13.7
1.14.4
25 changes: 8 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,13 @@ require File.expand_path('../config/application', __FILE__)

Rails.application.load_tasks

require 'solr_wrapper/rake_task'
unless Rails.env == 'production'
task('spec').clear
desc 'Run HydraDAM specs'
task spec: 'hydradam:spec'

# unless Rake::Task.task_defined? :spec
# begin
# require 'rspec/core/rake_task'
# RSpec::Core::RakeTask.new(:spec)
# rescue LoadError
# # no rspec available
# end
# end
desc 'Run HydraDAM CI tests'
task ci: 'spec'

task('spec').clear
desc 'Run HydraDAM specs'
task spec: 'hydradam:spec'

desc 'Run HydraDAM CI tests'
task ci: 'spec'

task default: 'ci'
task default: 'ci'
end
2 changes: 1 addition & 1 deletion app/controllers/curation_concerns/file_sets_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module CurationConcerns
class FileSetsController < ApplicationController
include CurationConcerns::FileSetsControllerBehavior
include HydraDAM::StorageControllerBehavior
include ::StorageControllerBehavior
end
end
3 changes: 0 additions & 3 deletions app/controllers/storage_controller_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ module StorageControllerBehavior
require 'hydradam/storage_proxy_client'

def show

# require 'pry'; binding.pry

begin
storage_proxy_response = storage_proxy.status(filename).body
rescue Faraday::ConnectionFailed => e
Expand Down
2 changes: 1 addition & 1 deletion config/blacklight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ test: &test
url: http://localhost:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/hydra-test
production:
adapter: solr
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/blacklight-core" %>
url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:8983/solr/phydo-production" %>

5 changes: 5 additions & 0 deletions config/initializers/workaround_for_active_fedora_noid.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# TODO
# This is part of a back port of a patch introduced in curation_concerns ~>
# 1.7.x. This should not be required after upgrading to cuation_concerns ~>
# 1.7.x. See https://github.com/projecthydra/curation_concerns/pull/1061/files
require 'active_fedora/noid'
4 changes: 4 additions & 0 deletions config/role_map.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# TODO: Not sure what we really want for 'production' here.
production:
archivist:
- archivist1@example.com
development:
archivist:
- archivist1@example.com
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Rails.application.routes.draw do

mount Preservation::Engine, at: '/preservation'
concern :range_searchable, BlacklightRangeLimit::Routes::RangeSearchable.new
mount Blacklight::Engine => '/'
mount BlacklightAdvancedSearch::Engine => '/'
Expand Down
2 changes: 0 additions & 2 deletions lib/hydradam/storage_proxy_client.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'pry'

module HydraDAM
class StorageProxyClient
attr_accessor :host, :port, :store, :cache, :api_prefix,
Expand Down
2 changes: 0 additions & 2 deletions lib/pbcore.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require 'xml_validator'
require 'pry'


module PBCore

Expand Down
2 changes: 0 additions & 2 deletions spec/lib/xml_validator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require 'spec_helper'
require 'xml_validator'
require 'fixtures'
require 'pry' # debug only


describe XMLValidator do

Expand Down
Loading

0 comments on commit 3a857bf

Please # to comment.