shards 2.4.1 → 2.4.2

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: 849b30a33034ec813e1cd1153fb5c8834b2bfb802ae14d899cd9969a45f89d9d
4
- data.tar.gz: fa1640cb840f939608a953a472406e81c8a140eeb20f400be61a60edccccc9bd
3
+ metadata.gz: 490d4eb8ecb0429421e635ad060f13ea564a4c0c60832f5702b0389a66e9bf7f
4
+ data.tar.gz: 1c34080cdeb2307ffb79fa14a94d78bda2ae89abbbdc64c41dd895cbcce7898d
5
5
  SHA512:
6
- metadata.gz: 1f9abc36a3823eac76f71f3cf4221cafc8153502f391ffe6e7bd75819a4d824abaf627da6183cf870d2b76cfea68d79e511455ad66a440352fca0fdbc7272076
7
- data.tar.gz: 2947eb697f053c05db45c2380ba704893369380713286f6344f38e31f8695e13f79ef39c7192a6ddc35539e5a17e7c5888e9b4393beb8eeb307bf90b1734ebd1
6
+ metadata.gz: 1b00ed1a01d6dabeb5747706ecdb266126ed86f9b1e49edf3432002beb06f427fa27072d49dfa5147c043ff8078e950038b388cc588a1b4f16947ef611cb8bd8
7
+ data.tar.gz: cd90b43dc822688f1691830db51d79c7f22be62ec85f8568d583783e27da45efd8e88eb9b61b036a50601dfc4486528fbf031630d1149c6a39f1bcd341d74f7f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shards (2.4.1)
4
+ shards (2.4.2)
5
5
  aws-sdk-ec2 (~> 1.48)
6
6
  aws-sdk-elasticloadbalancing (~> 1.5)
7
7
  aws-sdk-elasticloadbalancingv2 (~> 1.14)
@@ -24,13 +24,13 @@ GEM
24
24
  rspec-expectations (>= 2.99)
25
25
  thor (~> 0.19)
26
26
  aws-eventstream (1.0.1)
27
- aws-partitions (1.108.0)
27
+ aws-partitions (1.107.0)
28
28
  aws-sdk-core (3.36.0)
29
29
  aws-eventstream (~> 1.0)
30
30
  aws-partitions (~> 1.0)
31
31
  aws-sigv4 (~> 1.0)
32
32
  jmespath (~> 1.0)
33
- aws-sdk-ec2 (1.55.0)
33
+ aws-sdk-ec2 (1.54.0)
34
34
  aws-sdk-core (~> 3, >= 3.26.0)
35
35
  aws-sigv4 (~> 1.0)
36
36
  aws-sdk-elasticloadbalancing (1.7.0)
@@ -23,7 +23,17 @@ module Shards
23
23
  end
24
24
 
25
25
  def file_path file_name
26
- File.join(ENV['ENGINEERING_ROOT_PATH'],ENV['CONFIG_FILES_ROOT_PATH'], dir ,file_name)
26
+ File.join(target_config_dir(dir) ,file_name)
27
+ end
28
+
29
+ def target_config_dir target_dir
30
+ File.join(ENV['ENGINEERING_ROOT_PATH'],ENV['CONFIG_FILES_ROOT_PATH'], target_dir)
31
+ end
32
+
33
+ def copy_file_to_extra_dirs directories
34
+ directories.each do |target_dir|
35
+ FileUtils.cp_r file, target_config_dir(target_dir), remove_destination: true
36
+ end
27
37
  end
28
38
 
29
39
  def write_yaml
@@ -40,7 +50,7 @@ module Shards
40
50
 
41
51
  def ssh! command
42
52
  ssh_conn do |ssh|
43
- ssh.exec! command
53
+ ssh.exec! command
44
54
  end
45
55
  end
46
56
 
@@ -65,6 +65,12 @@ module Shards
65
65
  ENV['PROXY_USER']
66
66
  end
67
67
 
68
+ def write_extra_config_dirs stage
69
+ unless stage.get('extra_config_dirs').empty?
70
+ copy_file_to_extra_dirs(stage.get('extra_config_dirs'))
71
+ end
72
+ end
73
+
68
74
  end
69
75
 
70
76
  end
@@ -56,6 +56,11 @@ module Shards
56
56
  write_yaml
57
57
  end
58
58
 
59
+ def write_yaml
60
+ super
61
+ write_extra_config_dirs stage
62
+ end
63
+
59
64
  def name_param
60
65
  @name_param || name
61
66
  end
@@ -51,6 +51,11 @@ module Shards
51
51
  write_yaml
52
52
  end
53
53
 
54
+ def write_yaml
55
+ super
56
+ write_extra_config_dirs stage
57
+ end
58
+
54
59
  end
55
60
  end
56
61
 
@@ -77,10 +77,22 @@ module Shards
77
77
  { status: resp.exitstatus, message: message }
78
78
  end
79
79
 
80
- def hosts_to_check
80
+ def web_server_hosts
81
81
  name=='prod' ? get_production_ips : [ internal_host ]
82
82
  end
83
83
 
84
+ def hosts_to_check
85
+ web_server_hosts + get('extra_boxes_to_reload')
86
+ end
87
+
88
+ def extra_boxes_to_reload
89
+ []
90
+ end
91
+
92
+ def extra_config_dirs
93
+ []
94
+ end
95
+
84
96
  def get_production_ips
85
97
  ip_search=Shards::IpSearch.new self
86
98
  @ips||=ip_search.ips
@@ -1,3 +1,3 @@
1
1
  module Shards
2
- VERSION = "2.4.1"
2
+ VERSION = "2.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shards
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego PL
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-19 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler