Ruby version: mri 2.2.2
NodeJs version: 0.10+
Redis Homebrew: brew install redis
To run using docker, cd
to the gfw-climate folder, ensure the files entrypoint.sh
and gfw-climate.sh
are execututable (chmod +x <filename>
), and then execute ./gfw-climate.sh develop
to start the development server on port localhost:5000
.
Just execute the script file in bin/setup
Depends on gfwc repository
Create .env file with:
RACK_ENV=development
GFW_URL=http://www.globalforestwatch.org
GFW_API_HOST=http://gfw-apis.appspot.com
GFW_DATA_S3=
BLOG_HOST=http://blog.globalforestwatch.org
TERMS_COOKIE=cookie_terms
REDISCLOUD_URL=redis://localhost:6379/0
CODECLIMATE_REPO_TOKEN=c5c128fcb301371d4b89bec2df714028e0a75deb8d732f49f922626aa84c3524
LAYER_SPEC=layerspec_nuclear_hazard
[email protected]
CDB_API_HOST=https://wri-01.cartodb.com/api/v2/sql
ASSETS_VERSION=latest
ASSETS_AB=false
GLAD_INSIGHT_CONFIG_ID=
GLAD_INSIGHT_ID=
SPREADSHEETS_ID=
DRIVE_PRIVATE_KEY_ID=
DRIVE_PRIVATE_KEY
OS X
brew install redis
brew info redis
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Add to .env:
REDISCLOUD_URL=redis://localhost:6379
Useful commands
redis-cli monitor
redis-cli flushall
npm install -g bower
bundle install
bower install
foreman start
or run script to flush redis and start foreman:
./start
Flush redis:
./clean
Run rspec:
bin/rspec
Run teaspoon:
rake teaspoon
Run all:
rake
Getting a list of enabled countries
curl "http://localhost:5000/api/countries" -X GET \
-H "Accept: application/json; application/gfwc-v1+json" \
-H "Content-Type: application/json"
Getting a specific country
curl "http://localhost:5000/api/countries/aus" -X GET \
-H "Accept: application/json; application/gfwc-v1+json" \
-H "Content-Type: application/json"
For API documentation visit /api/docs
Generate the docs!
rake docs:generate
Automatic deploys from staging are enabled
Every push to staging will deploy a new version of this app. Deploys happen automatically: be sure that this branch in GitHub is always in a deployable state and any tests have passed before you push.
Heroku wait for CI to pass before deploy.