capistrano-docker_cluster 1.0.7 → 1.0.8

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
  SHA256:
3
- metadata.gz: 7d70e28562c37c52476bb5b949a9552723fb6c13f3560b531182c83a8b5eecce
4
- data.tar.gz: 583801dc1d6a7aa8a7f6151080e25b260253708e695a09d7771caf71c3bf1b61
3
+ metadata.gz: bccf2aa54a04da36575a34851e9b815d15f449affbe16a74c00231c60775d50a
4
+ data.tar.gz: d2f8d8499821e616b4b1b58a5e77ce707f9c3b8d3379284faa66af3ffeedcd4a
5
5
  SHA512:
6
- metadata.gz: 90f7545615ee803bb598111b7e551ad7283c49c600f8727cf4521c79b21d1a24ff0a9a0d24bad4e063dd6e4a9f12393c49049d53a48c8b06da165465af1fca9f
7
- data.tar.gz: 695fb6766edfa3c90c267bd2b2a7447d117ec12e374bf70f8a070657bc488d2c7b5dac0de533d9d9d9c7dd452345e3ccba845e5dab42817612c13eb04f21768c
6
+ metadata.gz: ac43c04fa0abb4f41fefcc3f78838c7a54e81ef8a7c43ae7181f68c8d2de5726850aba26d203952dbf5670007fcfb40f98d755a652c5f61485102e7982d99e55
7
+ data.tar.gz: 0b8395d794c1ceae2219c055af592d911e61d3e9d3490dd9e8821170e8c1feec45f8d100e97d158b14b57f52c8b2045c913ce1b75905948e8bba0c7eb38bb4f0
data/CHANGE_LOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.8
2
+
3
+ * Add --all option to start and stop scripts.
4
+
1
5
  # 1.0.7
2
6
 
3
7
  * Fix rollback order so pull and tag is done on release path to get the correct version.
@@ -14,14 +14,17 @@ module Capistrano
14
14
  # the predefined configuration by calling `bin/start app`.
15
15
  def start_script(host)
16
16
  apps = Array(fetch_for_host(host, :docker_apps))
17
- cmd = "exec bin/docker-cluster"
17
+ cmd = "bin/docker-cluster"
18
18
  image_id = "#{fetch(:docker_repository)}:#{fetch(:docker_tag)}"
19
19
  prefix = fetch(:docker_prefix)
20
20
 
21
21
  cases = []
22
+ all = []
22
23
  apps.each do |app|
23
24
  args = app_host_args(app, host)
24
- cases << " '#{app}')\n #{cmd} #{args.join(' ')} --name '#{prefix}#{app}' --image '#{image_id}' \"$@\"\n ;;"
25
+ start_cmd = "#{cmd} #{args.join(' ')} --name '#{prefix}#{app}' --image '#{image_id}' \"$@\""
26
+ cases << " '#{app}')\n exec #{start_cmd}\n ;;"
27
+ all << " #{start_cmd}"
25
28
  end
26
29
 
27
30
  <<~BASH
@@ -35,12 +38,19 @@ module Capistrano
35
38
  cd $(dirname $0)/..
36
39
 
37
40
  typeset app=$1
41
+ if [ "$app" == "" ]; then
42
+ >&2 echo "Usage: $0 #{apps.join('|')}|--all"
43
+ exit 1
44
+ fi
38
45
  shift
39
46
 
40
47
  case $app in
41
48
  #{cases.join("\n")}
49
+ '--all')
50
+ #{all.join("\n")}
51
+ ;;
42
52
  *)
43
- >&2 echo "Usage: $0 #{apps.join('|')}"
53
+ >&2 echo "Usage: $0 #{apps.join('|')}|--all"
44
54
  exit 1
45
55
  esac
46
56
  BASH
@@ -78,6 +88,10 @@ module Capistrano
78
88
  cd $(dirname $0)/..
79
89
 
80
90
  typeset app=$1
91
+ if [ "$app" == "" ]; then
92
+ >&2 echo "Usage: $0 #{apps.join('|')}"
93
+ exit 1
94
+ fi
81
95
  shift
82
96
 
83
97
  case $app in
@@ -97,7 +111,9 @@ module Capistrano
97
111
  cases = []
98
112
  all = []
99
113
  apps.each do |app|
100
- cases << " '#{app}')\n exec bin/docker-cluster --name '#{prefix}#{app}' --count 0\n ;;"
114
+ stop_cmd = "bin/docker-cluster --name '#{prefix}#{app}' --count 0"
115
+ cases << " '#{app}')\n exec #{stop_cmd}\n ;;"
116
+ all << " #{stop_cmd}"
101
117
  end
102
118
 
103
119
  <<~BASH
@@ -111,11 +127,18 @@ module Capistrano
111
127
  cd $(dirname $0)/..
112
128
 
113
129
  typeset app=$1
130
+ if [ "$app" == "" ]; then
131
+ >&2 echo "Usage: $0 #{apps.join('|')}|--all"
132
+ exit 1
133
+ fi
114
134
 
115
135
  case $app in
116
136
  #{cases.join("\n")}
137
+ '--all')
138
+ #{all.join("\n")}
139
+ ;;
117
140
  *)
118
- >&2 echo "Usage: $0 #{apps.join('|')}"
141
+ >&2 echo "Usage: $0 #{apps.join('|')}|--all"
119
142
  exit 1
120
143
  esac
121
144
  BASH
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module DockerCluster
5
- VERSION = "1.0.7"
5
+ VERSION = "1.0.8"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-docker_cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2020-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano