mcrain 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d07708c123940b6ae6e2fa57fd8aa76590439d36
4
- data.tar.gz: b8ef280372ad693c31b52e8f62f38f7dba9cab80
3
+ metadata.gz: 14b5cc7a0134a7aa84cf8bb3add79184cb353134
4
+ data.tar.gz: 5ec94f7b6ead6189e0a9baf39bdcdcbeef464678
5
5
  SHA512:
6
- metadata.gz: a26b6d8f4dab3aa1a0e6b087df9a3af12dc7a0b0690551e38aa06e6252b61524b59c0a8ddd515e88037683f26a317f5f3b9c7fb26e8eb83207cc7145eb113591
7
- data.tar.gz: f67ce63e4b1d2dcc5d6f3020b56cda0a672bbfb946abeb977d60a12da59b94c9488cb12757c2df34aea4ec0714bc77c8d64de467880c2c190327cfadb0298b1c
6
+ metadata.gz: 21a4ff57facbdccce14a2f01b02b980bd4f1f28bb30615faccff1e6d35d696f3571d8d09a0613174e95dee39269c6089c314813124afcc516c59ab89a4970ee5
7
+ data.tar.gz: a08f4b31866e06b85b5f321c36aaea6c2de33f01fab466c3f9757e710df18ebebaa54045a940568808bea54e14ea8d8ca4c10bd2099c14ac5e8007f4949c8b40
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Mcrain
2
2
 
3
+ [![Circle CI](https://circleci.com/gh/groovenauts/mcrain/tree/master.svg?style=svg)](https://circleci.com/gh/groovenauts/mcrain/tree/master)
4
+
3
5
  Mcrain helps you to use docker container in test cases.
4
6
  It supports redis, rabbitmq and riak (stand alone node or clustering) currently.
5
7
 
data/circle.yml ADDED
@@ -0,0 +1,44 @@
1
+ machine:
2
+ ruby:
3
+ version: 2.2.2
4
+ services:
5
+ - docker
6
+
7
+ dependencies:
8
+ cache_directories:
9
+ - "~/docker"
10
+ pre:
11
+ - echo 'DOCKER_OPTS="$DOCKER_OPTS -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"' | sudo tee -a /etc/default/docker
12
+ - sudo service docker restart
13
+ - gem install bundler --version '~> 1.10.5'
14
+ - mkdir -p ~/docker
15
+ - if [[ -e ~/docker/mysql.tar ]]; then
16
+ docker load -i ~/docker/mysql.tar;
17
+ else
18
+ docker pull mysql:5.5;
19
+ docker save mysql:5.5 > ~/docker/mysql.tar;
20
+ fi
21
+ - if [[ -e ~/docker/redis.tar ]]; then
22
+ docker load -i ~/docker/redis.tar;
23
+ else
24
+ docker pull redis:2.8.19;
25
+ docker save redis:2.8.19 > ~/docker/redis.tar;
26
+ fi
27
+ - if [[ -e ~/docker/rabbitmq.tar ]]; then
28
+ docker load -i ~/docker/rabbitmq.tar;
29
+ else
30
+ docker pull rabbitmq:3.4.4-management;
31
+ docker save rabbitmq:3.4.4-management > ~/docker/rabbitmq.tar;
32
+ fi
33
+ - if [[ -e ~/docker/riak.tar ]]; then
34
+ docker load -i ~/docker/riak.tar;
35
+ else
36
+ docker pull hectcastro/riak:latest;
37
+ docker save hectcastro/riak:latest > ~/docker/riak.tar;
38
+ fi
39
+
40
+ test:
41
+ override:
42
+ - bundle exec rake spec:
43
+ environment:
44
+ DOCKER_HOST: tcp://127.0.0.1:2375
data/lib/mcrain/redis.rb CHANGED
@@ -28,11 +28,15 @@ module Mcrain
28
28
 
29
29
  attr_accessor :db_dir
30
30
 
31
+ DB_DIR_ON_CONTAINER = '/data'.freeze
32
+
31
33
  def build_docker_options
32
34
  r = super
33
- if db_dir
35
+ if db_dir && !db_dir.empty?
34
36
  r['Volumes'] ||= {}
35
- r['Volumes']["/data"] = File.expand_path(db_dir)
37
+ r['Volumes'][DB_DIR_ON_CONTAINER] = {}
38
+ r['HostConfig']['Binds'] ||= []
39
+ r['HostConfig']['Binds'] << "#{db_dir}:#{DB_DIR_ON_CONTAINER}"
36
40
  end
37
41
  return r
38
42
  end
@@ -1,3 +1,3 @@
1
1
  module Mcrain
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcrain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - akm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-06 00:00:00.000000000 Z
11
+ date: 2015-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logger_pipe
@@ -118,6 +118,7 @@ files:
118
118
  - Rakefile
119
119
  - bin/console
120
120
  - bin/setup
121
+ - circle.yml
121
122
  - exe/mcrain
122
123
  - lib/mcrain.rb
123
124
  - lib/mcrain/base.rb