Copyright© 2017 Merck Sharp & Dohme Corp. a subsidiary of Merck & Co., Inc., Kenilworth, NJ, USA. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Linea is a DocGraph tool that is designed to be a digital catalogue of publically available healthcare related datasets.
Note: All of these come directly from the Linea readme when this readme was made. Most of these rules are still relevant, especially 2 and 5.1 .
Please observe the following rules when contributing to this project:
- All code in the master branch is deployable, EC2 instances read from master anytime an instances is started
- All development must occur in feature branches.
- All code must be written test first using rspec.
- You should push your branch changes to stash at least once a day, if not more.
- Before pushing code or making a pull request, run the following:
rake Linea:quality:rubocop
andrake Linea:quality:slim
to see if you have any quality issues to fix.rake Linea:security
to see if you've introduced security issues
Please see the associated deployment instructions file, linea_deployment_instructions.md.
Please see the associated database migration instructions file, database_migration_instructions.md
Local development requires the following to be installed:
- brew and Xcode command line utilities (when on Mac) - see http://brew.sh/
- rvm
- Git
- Ruby 2.2.5
- Postgres 9.3.x
If you're developing on a mac, you will need to install gnupg prior to install ruby and rvm:
brew install gnupg gnupg2
Install rvm:
# fetch key for rvm
command curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -
# install rvm
\curl -L https://get.rvm.io | bash -s stable
# add the rvm script to your .bash_profile
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
# logout/login (to load rvm) or open another console window
# load latest rvm
rvm get head
rvm install 2.2.5 --patch railsexpress
rvm use 2.2.5@global
gem install bundler
LaunchRocket is a Mac PreferencePane that can be used to graphically start services such as ElasticSearch, Redis, MySQL, Postgresql, etc..
brew cask install launchrocket
brew install Caskroom/cask/java
brew install elasticsearch
brew info elasticsearch
If you would like to forgo using LaunchRocket, you can follow these instructions:
# To have launchd start elasticsearch at login:
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
# Then to load elasticsearch now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
# Or, if you don't want/need launchctl, you can just run:
elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
The following assumes you have Homebrew installed.
Start by installing postgres:
brew update
brew install postgres
brew info postgres
Create a default database/confguration:
initdb /usr/local/var/postgres
Add the following to your ~/.bash_profile
:
echo 'export PGHOST=localhost' >> ~/.bash_profile
Load the previous change with source ~/.bash_profile
.
Infomation about redis: http://redis.io
- either use brew (
brew install redis
)
or
- download latest version somewhere (~/tmp for example)
wget http://download.redis.io/releases/redis-3.2.0.tar.gz
- unpack redis-3.2.0.tar.gz
- run
make
- start redis with
src/redis-server
gem install sidekiq
The following assumes that SSH keys have been set up where this repository resides
# Get the latest code from stash
git clone repository link
cd Linea
# switch over to rvm 2.2.5@global if not already
rvm use 2.2.5@global
# copy over a few files
cp config/database.yml.sample config/database.yml
cp config/google_oauth.yml.sample config/google_oauth.yml
cp .env.example .env.development
cp .env.example .env.test
# install the other gems via bundler
bundle install
If you receive errors with libv8 while trying to bundle install, follow these instructions:
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
Start Redis, Postgresql, and ElasticSearch from the LaunchRocket preference pane.
Open up the Linea project in the text editor of your choice. Navigate to bin/setup and uncomment lines 18 and 20.
In your open terminal window, execute:
bin/setup
Go back into bin/setup and recomment lines 18 and 20.
Open up a new terminal window in the Linea directory and start sidekiq:
bundle exec sidekiq –c 5 –e development –P ./tmp/sidekiq.pid –r ./ -q elastic –q sidekiq
Assuming that everything went well, you should now be able to launch Linea from the folder using
rails server
Linea should now be available in your web browser at http://localhost:3000.
If you receive an error with Google Oauth after the server has been started and you attempt to log in, regenerate client id and client secret and edit the google_oauth.yml
file as per the oauth section of the deployment instructions.