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 +4 -4
- data/README.md +2 -0
- data/circle.yml +44 -0
- data/lib/mcrain/redis.rb +6 -2
- data/lib/mcrain/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14b5cc7a0134a7aa84cf8bb3add79184cb353134
|
4
|
+
data.tar.gz: 5ec94f7b6ead6189e0a9baf39bdcdcbeef464678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'][
|
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
|
data/lib/mcrain/version.rb
CHANGED
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.
|
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-
|
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
|