minke 1.5.9 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/minke/docker/docker_compose.rb +30 -4
- data/lib/minke/docker/system_runner.rb +12 -0
- data/lib/minke/tasks/cucumber.rb +1 -2
- data/lib/minke/tasks/run.rb +1 -2
- data/lib/minke/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDVmMTZmNmE1ODBkMzQ4ZmFkMThlZjYzZmNkOGVmN2IwZTQwZjM5NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGYyOTU4MDNkMjUyMGQxZDA0ZmQ1OGM2NTk3NmYwNzEyYTkxZWUxMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDNiODFjYjQ0ZDczYTA1MTEwNTQ2YjM1ZGEwZjNjZmI2NWU2NTk2MjU0N2Rk
|
10
|
+
MWYyNWUxYzJjODE5MWQyYTkxMDIxNjQ3MTc4NGI1ODlmMmQ5NTFkMWNjZGZm
|
11
|
+
NTU1Mjc4ODU0MTI2MjQwZmJmYjM0OTgyYmMxMzNhODcxOGJjOGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzkwODViOGYyYzU5MDVjMTNlN2M3Mjc0ODg0YTliOTllZmYwMTkwNDE2YmNh
|
14
|
+
ZmU2YTEwMDIxMDZjYjYzNDBlNTdjZDcyNzBhODNjM2ZlZmJhNTlhYWFmNDAw
|
15
|
+
NmY3OTViZGQwZDU1MTQ2NWY0ODI4MmZmYjk4YWJmOTM0MmIzMTM=
|
@@ -21,14 +21,29 @@ module Minke
|
|
21
21
|
##
|
22
22
|
# start the containers in a stack defined by the docker compose file
|
23
23
|
def up
|
24
|
-
|
24
|
+
unless ENV['DOCKER_NETWORK'].to_s.empty?
|
25
|
+
directory = create_compose_network_file
|
26
|
+
|
27
|
+
@system_runner.execute "docker-compose -f #{@compose_file} -f #{directory + '/docker-compose.yml'} up -d"
|
28
|
+
@system_runner.remove_entry_secure directory
|
29
|
+
else
|
30
|
+
@system_runner.execute "docker-compose -f #{@compose_file} up -d"
|
31
|
+
end
|
32
|
+
|
25
33
|
sleep 2
|
26
34
|
end
|
27
35
|
|
28
36
|
##
|
29
|
-
# stop the containers in a stack defined by the docker compose file
|
30
|
-
def
|
31
|
-
|
37
|
+
# stop the containers in a stack and removes them as defined by the docker compose file
|
38
|
+
def down
|
39
|
+
unless ENV['DOCKER_NETWORK'].to_s.empty?
|
40
|
+
directory = create_compose_network_file
|
41
|
+
|
42
|
+
@system_runner.execute "docker-compose -f #{@compose_file} -f #{directory + '/docker-compose.yml'} down"
|
43
|
+
@system_runner.remove_entry_secure directory
|
44
|
+
else
|
45
|
+
@system_runner.execute "docker-compose -f #{@compose_file} down -d"
|
46
|
+
end
|
32
47
|
end
|
33
48
|
|
34
49
|
##
|
@@ -48,6 +63,17 @@ module Minke
|
|
48
63
|
def public_address container, private_port
|
49
64
|
@system_runner.execute_and_return "docker-compose -f #{@compose_file} port #{container} #{private_port}"
|
50
65
|
end
|
66
|
+
|
67
|
+
def create_compose_network_file
|
68
|
+
content = { 'version' => '2'.to_s, 'networks' => {'default' => { 'external' => { 'name' => ENV['DOCKER_NETWORK'] } } } }
|
69
|
+
|
70
|
+
directory = @system_runner.mktmpdir
|
71
|
+
|
72
|
+
temp_file = directory + '/docker-compose.yml'
|
73
|
+
@system_runner.write_file temp_file, YAML.dump(content)
|
74
|
+
|
75
|
+
directory
|
76
|
+
end
|
51
77
|
end
|
52
78
|
end
|
53
79
|
end
|
@@ -11,6 +11,18 @@ module Minke
|
|
11
11
|
return log.strip
|
12
12
|
end
|
13
13
|
|
14
|
+
def mktmpdir
|
15
|
+
Dir.mktmpdir
|
16
|
+
end
|
17
|
+
|
18
|
+
def remove_entry_secure dir
|
19
|
+
FileUtils.remove_entry_secure dir
|
20
|
+
end
|
21
|
+
|
22
|
+
def write_file filename, data
|
23
|
+
File.open(filename, 'w') { |file| file.write(data) }
|
24
|
+
end
|
25
|
+
|
14
26
|
end
|
15
27
|
end
|
16
28
|
end
|
data/lib/minke/tasks/cucumber.rb
CHANGED
data/lib/minke/tasks/run.rb
CHANGED
data/lib/minke/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nic Jackson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|