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

Commit

Permalink
Rename local environment to development
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jun 13, 2018
1 parent b85e2ef commit 06f5d7b
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 56 deletions.
3 changes: 1 addition & 2 deletions .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
# http://www.hezmatt.org/~mpalmer/blog/2013/10/13/rack_env-its-not-for-you.html
export RACK_ENV=development

export APP_ENV=local
export APP_ENV=development

export PORT=3000

export SDR_USER=sdrUser
export SDR_PASS=sdrPass

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ A web application for providing access to Digital Objects in SDR Storage.
## Requirements

- database service options
+ mysql - test, local, development
+ oracle - integration, staging, production
+ mysql - test, development
+ oracle - staging, production

## Getting Started

Expand Down Expand Up @@ -55,8 +55,8 @@ in the [dlss/shared_configs](https://github.com/sul-dlss/shared_configs) private
- Command line values that precede `./bin/<util>`, `foreman`, or `rackup`, e.g.

```sh
APP_ENV=local RACK_ENV=development .binstubs/foreman start
APP_ENV=local RACK_ENV=development .binstubs/rackup
APP_ENV=development RACK_ENV=development .binstubs/foreman start
APP_ENV=development RACK_ENV=development .binstubs/rackup
```

- `.env` file settings can supplement, without replacing, existing values
Expand Down
10 changes: 5 additions & 5 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ dockerize boot DLSS/$service:$branch
# Dockerfile:
#
# FROM howareyou/ruby:1.9.3-p448
#
#
# RUN rm -fr /var/apps/snomed/*
# ADD ./ /var/apps/snomed
#
#
# RUN \
# . /.profile ;\
# rm -fr /var/apps/snomed/.git/* ;\
# cd /var/apps/snomed && bundle install --local ;\
# cd /var/apps/snomed && bundle install --development ;\
# # END RUN
#
#
# CMD . /.profile && cd /var/apps/snomed && bin/test && foreman start
#
#
# EXPOSE 3000
3 changes: 1 addition & 2 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ log = File.new("log/sdr.log", "a+")
#$stdout.reopen(log)

# Hack for dev so log messages appear in terminal instead of log file
unless ENV['APP_ENV'] == 'local'
unless ENV['APP_ENV'] == 'development'
$stderr.reopen(log)
$stderr.sync = true
$stdout.sync = true
end

5 changes: 0 additions & 5 deletions config/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ module SdrServices
# rspec config
raise "Invalid RACK_ENV=#{ENV['RACK_ENV']}, should be 'test'" unless ENV['RACK_ENV'] == 'test'
env_file = 'test'
when :local
# developer workstation config
raise "Invalid RACK_ENV=#{ENV['RACK_ENV']}, should be 'development'" unless ENV['RACK_ENV'] == 'development'
env_file = 'local'
when :integration
raise "Invalid RACK_ENV=#{ENV['RACK_ENV']}, should be 'development'" unless ENV['RACK_ENV'] == 'development'
env_file = 'integration'
Expand All @@ -80,4 +76,3 @@ module SdrServices
# behavior. Sequel will automatically reconnect on an as needed basis in the child
# processes, so you only need to do the following in the parent process:
ArchiveCatalogSQL::DB.disconnect

8 changes: 1 addition & 7 deletions config/database_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,14 @@ test:
# host: localhost
# port: 3306
database: archive_catalog_test
# database: myapp_test
encoding: utf8
user: sdrAdmin
password: sdrPass
# username: travis
# password:

# local is for developer workstations
local:
development:
adapter: mysql2
# host: localhost
# port: 3306
database: archive_catalog_development
user: sdrAdmin
password: sdrPass


2 changes: 1 addition & 1 deletion config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#set :bundle_flags, '--deployment --quiet' # this is default
#set :bundle_env_variables, {} # this is default
set :bundle_binstubs, -> { shared_path.join('.binstubs') }
set :bundle_without, 'development local test'
set :bundle_without, 'development test'
set :bundle_flags, '--deployment'

# Default value for linked_dirs is []
Expand Down
7 changes: 2 additions & 5 deletions lib/sdr/archive_catalog_sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ArchiveCatalogSQL
LOG = Logger.new(log_file)

def self.log_model_info(m)
if ['local','development'].include?(APP_ENV)
if ['development'].include?(APP_ENV)
LOG.info "table: #{m.table_name}, columns: #{m.columns}, pk: #{m.primary_key}"
end
end
Expand All @@ -51,7 +51,7 @@ def self.log_model_info(m)
db_config = db_configs[APP_ENV]
raise "Missing db_config for APP_ENV=#{APP_ENV}" if db_config.nil?

if ['test','local','development'].include?(APP_ENV)
if ['test', 'development'].include?(APP_ENV)
require 'mysql2'
DB = Sequel.mysql2(:host=>db_config['host'],
:port=>db_config['port'],
Expand Down Expand Up @@ -169,6 +169,3 @@ class NewReplica < Sequel::Model
#DigitalObject.all.each {|d| d.delete }

end



24 changes: 12 additions & 12 deletions lib/sdr/public/file.README.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
File: README

&mdash; SDR Services REST API Documentation

</title>

<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
Expand All @@ -30,31 +30,31 @@
<body>
<div id="header">
<div id="menu">
<a href="_index.html">Index</a> &raquo;

<a href="_index.html">Index</a> &raquo;
<span class="title">File: README</span>


<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

<div id="search">

<a class="full_list_link" id="class_list_link"
href="class_list.html">
Class List
</a>

<a class="full_list_link" id="method_list_link"
href="method_list.html">
Method List
</a>

<a class="full_list_link" id="file_list_link"
href="file_list.html">
File List
</a>

</div>
<div class="clear"></div>
</div>
Expand All @@ -79,8 +79,8 @@
<li>Command line values that precede ./bin/<util>, foreman, or rackup, e.g.

<ul>
<li>APP_ENV=local RACK_ENV=development .binstubs/foreman start</li>
<li>APP_ENV=local RACK_ENV=development .binstubs/rackup</li>
<li>APP_ENV=development RACK_ENV=development .binstubs/foreman start</li>
<li>APP_ENV=development RACK_ENV=development .binstubs/rackup</li>
<li>This is used in ./bin/test.sh</li>
</ul></li>
<li>.env file can supplement, without replacing existing values</li>
Expand All @@ -95,4 +95,4 @@
</div>

</body>
</html>
</html>
24 changes: 12 additions & 12 deletions lib/sdr/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
File: README

&mdash; SDR Services REST API Documentation

</title>

<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
Expand All @@ -30,31 +30,31 @@
<body>
<div id="header">
<div id="menu">
<a href="_index.html">Index</a> &raquo;

<a href="_index.html">Index</a> &raquo;
<span class="title">File: README</span>


<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

<div id="search">

<a class="full_list_link" id="class_list_link"
href="class_list.html">
Class List
</a>

<a class="full_list_link" id="method_list_link"
href="method_list.html">
Method List
</a>

<a class="full_list_link" id="file_list_link"
href="file_list.html">
File List
</a>

</div>
<div class="clear"></div>
</div>
Expand All @@ -79,8 +79,8 @@
<li>Command line values that precede ./bin/<util>, foreman, or rackup, e.g.

<ul>
<li>APP_ENV=local RACK_ENV=development .binstubs/foreman start</li>
<li>APP_ENV=local RACK_ENV=development .binstubs/rackup</li>
<li>APP_ENV=development RACK_ENV=development .binstubs/foreman start</li>
<li>APP_ENV=development RACK_ENV=development .binstubs/rackup</li>
<li>This is used in ./bin/test.sh</li>
</ul></li>
<li>.env file can supplement, without replacing existing values</li>
Expand All @@ -95,4 +95,4 @@
</div>

</body>
</html>
</html>
2 changes: 1 addition & 1 deletion lib/sdr/sdr_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Base < ::Sinatra::Base
register Sinatra::AdvancedRoutes

# Register development extensions
configure :local, :development do
configure :development do
require 'sinatra/reloader'
register Sinatra::Reloader
end
Expand Down

0 comments on commit 06f5d7b

Please sign in to comment.