-
Notifications
You must be signed in to change notification settings - Fork 2
Installation Instructions
This contains instructions for installing on Ubuntu Linux. This has been tested on iPlant Atmosphere but should work on any cloud provider that supports Ubuntu.
-
Login over ssh
-
Install packages
sudo apt-get install git postgresql libpq-dev ruby bundler
-
Clone traitdb repo
git clone https://github.com/NESCent/TraitDB.git
-
Install dependencies
cd TraitDB bundle install
-
Create a postgres user
sudo -u postgres createuser -d traitdb_prod -P # will prompt for a password, make one up
-
Obtain a Google App ID and app secret from Google Developer Console.
- Start here: https://github.com/zquestz/omniauth-google-oauth2#google-api-setup
- Click Credentials, and OAuth2 Create new Client ID
- Type: Web Application
- Redirect URI: http://your-server:3000/users/auth/google_oauth2/callback
- Javascript Origins: http://your-server:3000
-
Configure database and Google OAuth credentials
export TRAITDB_PG_PROD_USER="traitdb_prod" export TRAITDB_PG_PROD_PASS="<your password here>" export TRAITDB_PG_PROD_HOST="127.0.0.1" export TRAITDB_PG_PROD_PORT="5432" export TRAITDB_GOOGLE_APP_ID="xxxxx.apps.googleusercontent.com" export TRAITDB_GOOGLE_APP_SECRET="xXxXxXXX"
-
Install the database
RAILS_ENV=production rake db:setup
-
Compile assets
RAILS_ENV=production rake assets:precompile
-
Start the webapp
RAILS_ENV=production rails server -d
-
Create an admin user
-
Visit http://your-server:3000 in your web browser
-
Click Sign In
-
Authenticate with a Google Account
-
In the ssh console, upgrade this user to an admin
RAILS_ENV=production rake traitdb:upgrade_admin[<[email protected]>] Upgrading [email protected]
-
Start a worker
mkdir tmp RAILS_ENV=production script/delayed_job start
-
See README for further instructions on creating projects and uploading YAML configs
-
Login over ssh
-
Configure database and Google OAuth credentials (Consider putting these in a file and sourcing it on login)
export TRAITDB_PG_PROD_USER="traitdb_prod" export TRAITDB_PG_PROD_PASS="<your password here>" export TRAITDB_PG_PROD_HOST="127.0.0.1" export TRAITDB_PG_PROD_PORT="5432" export TRAITDB_GOOGLE_APP_ID="xxxxx.apps.googleusercontent.com" export TRAITDB_GOOGLE_APP_SECRET="xXxXxXXX"
-
Start a worker (Consider installing in init.d or upstart)
RAILS_ENV=production script/delayed_job start
-
Start the webapp (Consider installing in init.d or upstart)
RAILS_ENV=production rails server -d