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: 6f9d8ebd3c6975691b22dfa48f35a2a7e526dc9b
4
- data.tar.gz: 5f8a11a25b113318903d90a6405cb6c5b8ca288a
3
+ metadata.gz: 1893e9123b779f50a32c14c02c9b750b6765cd2d
4
+ data.tar.gz: 487bcd3c8c06da68b4cc6b81b078c98d0823ca2a
5
5
  SHA512:
6
- metadata.gz: e882f99869bb2f687d67fa7c8e242352745152e391c693312ce0ce2ff888ad04d1cc7b945f8594ee037b45c42584c613cdf0f033986fb889a7192ef12cd60bf5
7
- data.tar.gz: bb2cf7d458f3a48cf6dbb561e63da0a40f95ca758adab87bf4636b2cd051014cbd232e6a5b12be425c8a33be761f3e5a75d466d11bc1f190e280b19fda3bac3f
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.6'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-dockercompose-interactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Hanoldt