Services that support ODI's operation as an open organisation.
Ruby Cucumber
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
certs/test
features
fixtures/vcr_cassettes
lib
spec
.gitignore
.rspec
.ruby-version
.travis.yml
Gemfile
Gemfile.lock
Guardfile
LICENSE.md
README.md
Rakefile
open-orgn-services.gemspec

README.md

Open Organisation Services

Build Status Dependency Status Code Climate

This repository is for code for services that support the ODI's operation as an open organisation. Our aim is to publish open data as a mechanism to help us function more effectively, and to act as a demonstrator of both the technical and policy challenges.

Feature documentation can be found on Relish.

Setup

Add to Gemfile:

gem 'open-orgn-services', :git => 'https://github.com/theodi/open-orgn-services.git'

And require if necessary:

require 'open-orgn-services'

Configuration is loaded from environment variables. See the environment section below for the list of which variables must be set.

Development

You can start a local console using foreman run bundle console. This loads the app and environment.

Testing

There are Cucumber features and RSpec unit tests.

You can run the Cucumber features with

bundle exec cucumber features

And the specs with

bundle exec rspec

Make sure that all environment variables are setup to point to test systems as the test systems may be hit during test runs. This especially applies to Capsule CRM, Xero, Eventbrite and Mailchimp.

License

This code is open source under the MIT license. See the LICENSE.md file for full details.

Architecture

This repository consists of a whole bunch of glue scripts which connect various other systems. They should all have the following features:

  • Implemented as resque jobs.
  • Minimal; each job should be as small as possible, spawing other jobs rather than executing big bits of code.
  • Idempotent; they should be able to run many times with the same arguments and not cause problems.
  • Testable; minimal jobs are very easy to test. This is generally done with cucumber features.

We use VCR to mock away any HTTP requests during tests.

Environment

The following environment variables should be set in order to use this gem.

COURSES_TARGET_URL

EVENTBRITE_API_KEY
EVENTBRITE_USER_KEY
EVENTBRITE_ORGANIZER_ID

RACKSPACE_USERNAME
RACKSPACE_API_KEY
RACKSPACE_CONTAINER

GAPPS_FINANCE_SPOOL_COLLECTION
GAPPS_FINANCE_TARGET_COLLECTION
GAPPS_FINANCE_TARGET_KEY
GAPPS_USER_EMAIL
GAPPS_PASSWORD

CAPSULECRM_ACCOUNT_NAME
CAPSULECRM_API_TOKEN
CAPSULECRM_DEFAULT_OWNER

TRELLO_DEV_KEY
TRELLO_MEMBER_KEY

XERO_CONSUMER_KEY
XERO_CONSUMER_SECRET
XERO_PRIVATE_KEY_PATH

MAILING_LIST_API_KEY
MAILING_LIST_LIST_ID