capistrano-dockercompose-interactive 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1893e9123b779f50a32c14c02c9b750b6765cd2d
|
4
|
+
data.tar.gz: 487bcd3c8c06da68b4cc6b81b078c98d0823ca2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59bd78c64825f387f0f03408a1c562e5bd5dbbcfd3892f9cbbd11b7720ef2f826a8c4a7f6eb6296526b992f219c608296215b9a2ea39ae273da15ec9ed3b7df0
|
7
|
+
data.tar.gz: 4a953f13550390a658f929be54ede92542741904742fea18e18ad646481c8539eca7a509d0abac8ecd19ce5872584b0e9d7ca45e7275125bad0b35008fc9f323
|
data/README.md
CHANGED
@@ -33,9 +33,12 @@ require 'capistrano/dockercompose/interactive'
|
|
33
33
|
|
34
34
|
## Changes
|
35
35
|
|
36
|
+
### Version 0.0.7
|
37
|
+
* add `isup?`, `satrt`, `stop`, `restart`, `up`, `down`, `build`, `pull`, `start_or_restart` to `DockerCompose::Interactive::Instance`
|
38
|
+
|
36
39
|
### Version 0.0.2
|
37
40
|
* use clean modiule namespaces
|
38
|
-
|
41
|
+
|
39
42
|
### Version 0.0.1
|
40
43
|
* initial release
|
41
44
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'capistrano-dockercompose-interactive'
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.7'
|
8
8
|
spec.date = '2018-02-03'
|
9
9
|
spec.summary = 'Helps managing docker compose excution on local or remote with inetractive shell support'
|
10
10
|
spec.description = spec.summary
|
@@ -34,6 +34,50 @@ module DockerCompose
|
|
34
34
|
def service(name)
|
35
35
|
Service.new(self, name, config()['services'][name])
|
36
36
|
end
|
37
|
+
|
38
|
+
def isup?
|
39
|
+
count = execute_compose_command('ps -q | wc -l', capture = true)
|
40
|
+
count.to_i
|
41
|
+
rescue
|
42
|
+
false
|
43
|
+
end
|
44
|
+
|
45
|
+
# starts or restarts a docker compose
|
46
|
+
def start_or_restart
|
47
|
+
if isup?
|
48
|
+
restart()
|
49
|
+
else
|
50
|
+
up()
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def stop(args='')
|
55
|
+
execute_compose_command("stop #{args}")
|
56
|
+
end
|
57
|
+
|
58
|
+
def down(args='')
|
59
|
+
execute_compose_command("down #{args}")
|
60
|
+
end
|
61
|
+
|
62
|
+
def up(args='-d')
|
63
|
+
execute_compose_command("up #{args}")
|
64
|
+
end
|
65
|
+
|
66
|
+
def start(args='')
|
67
|
+
execute_compose_command("start #{args}")
|
68
|
+
end
|
69
|
+
|
70
|
+
def restart(args='')
|
71
|
+
execute_compose_command("restart #{args}")
|
72
|
+
end
|
73
|
+
|
74
|
+
def build(args='')
|
75
|
+
execute_compose_command("build #{args}")
|
76
|
+
end
|
77
|
+
|
78
|
+
def pull(args='')
|
79
|
+
execute_compose_command("pull #{args}")
|
80
|
+
end
|
37
81
|
end
|
38
82
|
end
|
39
83
|
end
|