Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
malakai97 committed Dec 12, 2016
2 parents a4f7899 + 59f3828 commit 4c2bfcc
Show file tree
Hide file tree
Showing 281 changed files with 8,264 additions and 2,423 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.rb text
18 changes: 15 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@
# Rubymine
/.idea

# rbenv local file
.ruby-version

# Ignore application configuration
/.env.production
/.env.local
/.env

# Ignore rbenv
/.ruby-version
# Ignore rspec config
/.rspec

# Ignore test coverage
/coverage

# Emacs backup files
*~
Expand All @@ -36,11 +42,17 @@
# Configuration files
Gemfile.local
config/database.yml
config/dpn.yml
config/impersonate.yml.local
config/resque.yml
config/resque-pool.yml
config/secrets.yml
config/dpn.yml
config/resque.yml
config/environments/impersonate*.rb

# Ignore capistrano
/Capfile
/config/deploy.rb
/config/deploy/
/lib/capistrano
/lib/capistrano
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "dpn-rest-spec"]
path = dpn-rest-spec
url = https://github.com/dpn-admin/dpn-rest-spec.git
branch = master
2 changes: 0 additions & 2 deletions .rspec

This file was deleted.

1 change: 1 addition & 0 deletions .ruby_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3.1
49 changes: 38 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
language: ruby
rvm:
- 2.2.1
- 2.3.1

branches:
only:
- master
- develop
script: bundle exec rspec

services:
- mysql
- postgresql
- redis

env:
- DB=sqlite
- DB=mysql
- DB=postgres

before_install:
- if [[ $DB = 'sqlite' ]]; then echo "gem 'sqlite3'" > Gemfile.local; fi
- if [[ $DB = 'mysql' ]]; then echo "gem 'mysql2'" > Gemfile.local; fi
- if [[ $DB = 'postgres' ]]; then echo "gem 'pg'" > Gemfile.local; fi

install:
- bundle install --jobs=3 --retry=3
- sqlite3 --version
- mysql --version
- psql --version

before_script:
- bundle exec rake config
- cp config/database.yml.travis-$DB config/database.yml
- if [[ $DB = 'sqlite' ]]; then bundle exec rake db:create; fi
- if [[ $DB = 'mysql' ]]; then mysql -e 'CREATE DATABASE dpn;'; fi
- if [[ $DB = 'postgres' ]]; then psql -c 'CREATE DATABASE dpn;' -U postgres; fi
- bundle exec rake db:migrate

script: bundle exec rspec --tag ~broken_in_ci

script:
- if [[ $DB = 'sqlite' ]]; then bundle exec rspec --tag ~broken_in_sqlite; fi
- if [[ $DB = 'mysql' ]]; then bundle exec rspec; fi
- if [[ $DB = 'postgres' ]]; then bundle exec rspec; fi

addons:
code_climate:
repo_token: ce328d44d99a09d03c1dac2198c731dc8bfd22374fefc1917ce528b25a06ec4e

notifications:
slack:
secure: >
tBgfhb2PJNY+ZW0m1PUc+RnZKfblz4YxjQu7YAFyccTPNjrwKyWcVCGxFZi1mxPBLuO2D7DwivosAekTBx
4bJi/iNC3Ihr4HOjfYehLgon2HM8Y/taeKIsqzYnnj/Tmd6uCUOf/PwEAnGN/BS0i++1ky3iGQDHJmU9J1
R4caNo8ahpco3Ac20b1Jr5qJgRVqs1kKQ3Q3O9UaVtIxepli1G/qWqrUtkSzdSPDblYdH0szWNH8Goyzdu
BFnPiIQD9ZlNs2JTiYDjRm8eLVIErJUHXSIXn5jNEqooz1vuBvxxSkfPP8Uq3TNM7Ner1HrVZtY28QB2Fw
ayzcV4pabLgVnBum78Z9a7XWPFQjaYj3NwCKYXlP1OZSpfPvFQjm/5WdCs1vW/omb1zC8LYbsHdXI/97x6
IsP8pbZy1dU8yjyeQI3eI1x2PK8uYcDEjapxv/HzvTjBQO/6rwkjuF1cIJVW0A5PsEwoiYO0jXvwg+EZCV
ziCihNnixG2BP6oP1dd09QZywBjtUm6iZZAhJYDIp18CzSgX1boMhPgRkO13HLzLMmyTwBDgSK43VQ4Pxd
MOli3sO0Bq1vTPFMHIDjAWEghoioyhFNgmXBLYb1QbyuthNevAJTs5vZx2ztXHJ92z+eN193YA1v6WPCVm
NvOaPaLi/T2BTg/jzFeDkeUd8nA=
NPN5UAfze0ArE08cpxZlgZ0dN1s2FSeoKaJnf/zElBM+GrL4WDsGwUfgMc9yqIgc3aiDc1HHjzkNtqJynz2+bkMSBqtxzXteZ/Dz1hklXv6u2SCjuVCEyb+rzq488fN78gB5ohV9ovzAFuPm+T1b/vnXmSYBtJbnm8TRxgHHkM5x1gNE1FY+oZERByIiL+KSrG/k3pqFF1AtY3tt0hGDSMp1xhRblDdPUkq8FydApxUxI/dr5Aq8yN7QX4FWQvjm4Oka9+W16mIz7FiYo16r1BgSOWhsFEfub/PhTdD7AJyx3919xjvmrXZf5TVCYrxDmqPq4Ijgi9tgI2zxYyKyydB4U3yV+yGbM3zWFDHDKdX+iWdxkUl7iCZ3VXjvjpZj8WoFixQcOXwBq3HH5j9OEFZsgWhGa9cbvMvqfXKi23NCW1ybRVzbTO6GfjPi7GOByTKgBBf54wQPf4zD/GBehHrmGQV5ylWhPHlWYE5YmoKFrFczwbv9iUXIM+4ytMHYF+PcvLjVEPVOSLxw7F7d4ZE6hLpDKl9sXlZfoLpNYQNrlPBbFJEN/RBvUwX98Z2Ks+FEP2j28FSB3tnw4RsHCGrWmGeLL+K7UReASOXJY679sn9GlAtvNWO28MzFxAYOWxfSHNJO8jWtpBo7xxZrxw0RLr+vJlwsQFMwxXXLl7s=
40 changes: 31 additions & 9 deletions Cluster.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,55 @@
## Running a Local DPN Cluster

You can run a local DPN REST cluster using the run_cluster script in the script
directory. If you have never run the cluster before, you'll need to set up the
SQLite databases for the cluster by running this command from the top-level directory
of the project:
Starting in version 2.0, you must have an "impersonate" configuration
in your config/dpn.yml file so the local cluster can load the right
configuration settings. The `rake config` task will create this when
it copies files from `lib/templates/config/current`. So, your `config/dpn.yml`
file, based on `lib/templates/config/current/dpn.yml`, should include a
section like this:

```
./script/setup_cluster.rb
impersonate:
local_namespace: <your namespace>
local_api_root: http://127.0.0.1
staging_dir: <%= File.join "/tmp", "dpnrepo", "staging" %>
repo_dir: <%= File.join "/tmp", "dpnrepo", "preservation" %>
queue_adapter: :test
```

Similarly, your `config/database.yml` file must also include entries to
impersonate each of the DPN nodes. See the file
`lib/templates/config/current/database.yml` for an
example (which is used by `rake config`).

Once these settings are present, you can run a local DPN REST cluster
using the `script/run_cluster` script. If you have
never run the cluster before, you'll need to set up the SQLite
databases for the cluster by running this command from the top-level
directory of the project:

```
bundle exec ./script/setup_cluster.rb
```

If you have run the cluster before, and you have new database migrations to run, run
this from the top-level directory of the prject:

```
./script/migrate_cluster.rb
bundle exec ./script/migrate_cluster.rb
```

When the databases are ready, run the cluster with this command:

```
./script/run_cluster.rb -f
bundle exec ./script/run_cluster.rb -f
```

The -f option loads all of the fixtures under test/fixtures/integration.
As long as your migrations are up to date, you can set up and run the cluster
with a single command, like this:

```
./script/setup_cluster.rb && ./script/run_cluster.rb -f
bundle exec ./script/setup_cluster.rb && bundle exec ./script/run_cluster.rb -f
```

This will run five local DPN nodes on five different ports, each
Expand Down Expand Up @@ -115,4 +137,4 @@ To test the synching of bags and replication requests with specific characterist
through the admin UI, or you can enter them as YAML records in
test/fixtures/integration/<node>/bags.yml. When you restart the cluster, all of the
old data from the last sync run will be deleted, and the nodes will load whatever
data is under the test/fixtures/integration directory.
data is under the test/fixtures/integration directory.
60 changes: 43 additions & 17 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,51 @@

source 'https://rubygems.org'

ruby '~> 2.3.0'

# ----------------------------------------------
# Include gems for your local environment here.
# e.g. gem "mysql2", group: :production
# ----------------------------------------------

if File.exists? "Gemfile.local"
eval_gemfile "Gemfile.local"
if File.exist? 'Gemfile.local'
eval_gemfile 'Gemfile.local'
end

gem 'rails', '~> 4.2.5'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '~> 2.7'
gem 'jbuilder', '~> 2.0'
gem 'rails', '~> 4.2'

gem 'active_scheduler', '~>0.3.0'
gem 'resque', '~>1.26.0'
gem 'resque-pool', '~>0.6.0'
gem 'resque-scheduler', '~>4.3.0'

gem 'cancan'
gem 'devise'

gem 'dpn-bagit', '~>0.3.0'
gem 'dpn-client', '~>2.0.0', git: 'https://github.com/dpn-admin/dpn-client.git'
gem 'dpn_swagger_engine'

gem 'bcrypt'
gem 'easy_cipher', '~>0.9.1'

gem 'json'
gem 'bcrypt', '~> 3.1.7'
gem 'therubyracer', platforms: :ruby
gem 'kaminari'
gem 'delayed_job_active_record'
gem 'rsync'
gem 'dpn-bagit', '~>0.3.0'

gem 'lograge'
gem 'logstash-event'

gem 'okcomputer' # app monitoring

gem 'rpairtree'
gem 'easy_cipher', '~>0.9.1'
gem 'daemons'
gem 'rails_admin'
gem 'devise', '~> 3.5'
gem 'cancan'
gem 'rsync', '~>1.0.9'

gem 'sdoc', '~> 0.4.0', group: :doc

# Note: These are not in a group block because doing
# Note: These are not in a group block because doing
# so breaks group block usage in Gemfile.local
gem 'sqlite3', group: [:development, :test]
gem 'app_version_tasks', group: [:development, :test]
gem 'byebug', group: [:development, :test]
gem 'codeclimate-test-reporter', group: [:development, :test]
gem 'fabrication', group: [:development, :test]
Expand All @@ -45,5 +58,18 @@ gem 'pry', group: [:development, :test]
gem 'pry-doc', group: [:development, :test]
gem 'rspec-activejob', group: [:development, :test]
gem 'rspec-rails', group: [:development, :test]
gem 'rubocop', group: [:development, :test]
gem 'rubocop-rspec', group: [:development, :test]
gem 'simplecov', group: [:test]
gem 'web-console', '~> 2.1.3', group: [:development, :test]
gem 'yard', group: [:development, :test]

## Assets
# Use SCSS for stylesheets
gem 'sass-rails', group: [:assets]
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', group: [:assets]
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', group: [:assets]
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby, group: [:assets]
Loading

0 comments on commit 4c2bfcc

Please sign in to comment.