Skip to content

Instantly share code, notes, and snippets.

@harlow
Last active May 18, 2018 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save harlow/79be42637751ee582d6999acd321aedc to your computer and use it in GitHub Desktop.
Save harlow/79be42637751ee582d6999acd321aedc to your computer and use it in GitHub Desktop.
DynamoDB on Travis-CI

DynamoDB on Travis-CI

Leverage docker-compose to boot up the service and set a DYNAMODB_URL as an Env var. As described in the AWS Ruby SDK we can pass in a custom endpoint to the client.

client = Aws::DynamoDB::Client.new(endpoint: ENV['DYNAMODB_URL'])
version: '2'
services:
dynamodb:
image: tray/dynamodb-local
ports:
- "8000"
command: -inMemory -port 8000
test:
build:
context: .
args:
BUNDLE_GROUPS: default development test
command: bin/rspec
links:
- dynamodb
environment:
DYNAMODB_URL: http://dynamodb:8000/
RACK_ENV: test
@jeteve
Copy link

jeteve commented Oct 16, 2017

Hi,
That looks interesting, but how does one use it from a .travis.yml file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment