Google Drive → JSON → S3
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib Updates to README and CHANGELOG regarding deprecated and replaced fea… Jun 5, 2018
vendor added gitkeep in vendor/ Jun 20, 2016
.buildpacks added buildpacks May 17, 2015
.gitignore use npm for assets instead of bower Aug 29, 2017
CHANGELOG.md Updates to README and CHANGELOG regarding deprecated and replaced fea… Jun 5, 2018
Deckfile.json Description populates our listing. Nov 13, 2015
Dockerfile Ruby 2.5 May 22, 2018
Gemfile sinatra v2.0.3 Jun 12, 2018
Gemfile.lock sinatra v2.0.3 Jun 12, 2018
LICENSE
Procfile Initial commit May 13, 2015
README.md Updates to README and CHANGELOG regarding deprecated and replaced fea… Jun 5, 2018
Rakefile
app.json Postdeploy script in app.json wasn't working, don't use it May 28, 2015
config.ru Updates to README and CHANGELOG regarding deprecated and replaced fea… Jun 5, 2018
package-lock.json
package.json use npm for assets instead of bower Aug 29, 2017

README.md

Driveshaft

Driveshaft is a Sinatra application built to turn Google Spreadsheets and Google Documents into JSON with the click of a button.

Quickstart

For the full user guide, please refer to the documentation. Or, if you're somewhat familiar with Ruby applications and Google Authentication / S3, use this quickstart guide to get up and running.

Heroku Quickstart

Deploy instantly with Heroku.

Deploy

Dependencies

Be sure to have the following system dependencies installed:

# Git, Ruby, Node
$ brew install git node ruby

# Bundler
$ gem install bundler

Clone the repository and resolve app dependencies

$ git clone git@github.com:newsdev/driveshaft.git
$ cd driveshaft
$ npm install
$ bundle install

Environmental Variables

Driveshaft uses environmental variables for configuration. Set the following variables either at runtime on the commandline, or in your ~/.bash_profile.

Create a service account to authenticate against the Google API. You will need to set up a Google Developers Project with the Drive API enabled. Then create a set of credentials. Choose a service account key, and download the contents as JSON.

Store the JSON file on your computer (or your deployed environment), and set GOOGLE_APPLICATION_CREDENTIALS to the filepath where it is stored.

GOOGLE_APPLICATION_CREDENTIALS="/path/to/serviceaccount.json"

Required for S3 access. Use credentials that have access to any S3 buckets you wish to use.

AWS_ACCESS_KEY_ID="****"
AWS_SECRET_ACCESS_KEY="****"
AWS_REGION="us-east-1"

Driveshaft settings:

DRIVESHAFT_SETTINGS_MAX_VERSIONS="5" # set to a maximum number of previous file versions to keep on S3
DRIVESHAFT_SETTINGS_INDEX_FOLDER="****" # a Google Team Drive folder ID

Run the app locally

$ puma

http://localhost:9292/

Documentation

Documentation is available on the gh-pages branch. To view or contribute to the docs, checkout that branch, and run the following to start the documentation server:

gem install jekyll
jekyll server

Contribute

Questions / comments / feature requests / concerns? Please use the Issues page.

Contributors

Released at the OpenNews Code Convening at the 2015 Write The Docs conference, with the support of the Knight Foundation and The Mozilla Foundation.

License

The documentation and code are licensed under the Apache License, Version 2.0.

Copyright 2015 The New York Times Company.