zeployment 0.2.0 → 0.3.0
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/zeployment/version.rb +1 -1
- data/lib/zeployment.rb +25 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a17028b39f3ea949fe18cb3cbc58924d1661a82a58bbe378d7a40f7038f51247
|
4
|
+
data.tar.gz: a7fdee6ae2bdb7bbe50fa4f7abb8e7120b73b0393d8710d3e77f0cfd15297941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 471e482be69272cf163e570b9ff39766ea83a32936990910123a160bb305dee2254bdf3757adfc44aac8a3fbcd522ef797ad13b4317689ef5e71b6a468f28dc0
|
7
|
+
data.tar.gz: c1ccfa49d5fcb86e1b8125fecfa3a66c85e0d1d0350686ca7b2c0b0be4cbfcaa1f1314b6ebcc1d8fbdc11fb7b9c9ca0227ed3446bb467d7bccd9b2c43d2ad6ea
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/lib/zeployment/version.rb
CHANGED
data/lib/zeployment.rb
CHANGED
@@ -15,7 +15,6 @@ module Zeployment
|
|
15
15
|
return JSON.parse(load_balancer_instances_description)
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
18
|
def self.get_load_balancers_instances_description_command (name_of_load_balancer)
|
20
19
|
return "aws elb describe-instance-health --load-balancer-name #{name_of_load_balancer}"
|
21
20
|
end
|
@@ -71,5 +70,30 @@ module Zeployment
|
|
71
70
|
load_balancer_insrance_data_hash = get_load_balancer_particular_instance_data name_of_load_balancer, instance_id
|
72
71
|
return load_balancer_insrance_data_hash["InstanceStates"][0]["State"] == "InService"
|
73
72
|
end
|
73
|
+
|
74
|
+
def self.deploy (name_of_load_balancer, login_command_without_ip, commands_to_run)
|
75
|
+
instances_details = get_load_balancer_instances_description(name_of_load_balancer)
|
76
|
+
instances_details["InstanceStates"].each do |instance|
|
77
|
+
instance_id = instance["InstanceId"]
|
78
|
+
instance_ip = get_ip_address_of_ec2_from_id(instance_id)
|
79
|
+
puts instance_ip
|
80
|
+
deregister_instance_from_load_balancer(name_of_load_balancer, instance_id)
|
81
|
+
login_and_run_commands("#{login_command_without_ip}@#{instance_ip}", commands_to_run)
|
82
|
+
register_instance_with_load_balancer(name_of_load_balancer, instance_id)
|
83
|
+
wait_till_the_instance_in_service(name_of_load_balancer, instance_id)
|
84
|
+
puts ">>>>>>> Instance is in Service now <<<<<<<<<<<<<"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.wait_till_the_instance_in_service(name_of_load_balancer, instance_id)
|
89
|
+
while !instance_is_in_service?(name_of_load_balancer, instance_id) do
|
90
|
+
puts ">>>>>>> Instance Not in Service <<<<<<<<<<<<<"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.login_and_run_commands(login_command, commands_to_run)
|
95
|
+
system("#{login_command} << #{commands_to_run} ")
|
96
|
+
end
|
97
|
+
|
74
98
|
end
|
75
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeployment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naman Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|