dogids-cli 0.0.20 → 0.0.21

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: 648c482712018162c9cf439800a4bfb1e9a867f1
4
- data.tar.gz: 7a1af27153ecce16015f4768470c1409f84fb6e2
3
+ metadata.gz: d0351fc80065ab0dcf25950ab1d95e45844ae7db
4
+ data.tar.gz: 12d1a0abadbb686bdcf6b9548d1635f5972c3eea
5
5
  SHA512:
6
- metadata.gz: 3cfdbe776f64deeb3f5dde4317e87856ee57ecbd50a92f808fae8daeca4132d446af03e1db71b53c8ee8c5ea254cf3ca3b4d7184a46c6836f103cf2c21402ace
7
- data.tar.gz: 5089f64b096667de2d450c8c48a2820417f62d79a2d0dbee99e875252335bb7c7ea48e27cf3d544d1da2b9b9b28e1d892daeaba7b48a98d769afd5109eb90791
6
+ metadata.gz: ceb617c920bfab74c71547c89b918dce560c08ac0c23f1aa73d34b9cf18e13720929dc41ad15f7bc5edbbe23d8c34acc7d0091b48fcd9240ef4206ebcad06c50
7
+ data.tar.gz: 99af5030866da05e75a6e817e3062c6af906e81f278d5d6866567cb59a911530bd669ff34ef922aea6484b7a24c491becb0bf2c63906e8243d4061331a0082b0
data/dogids_cli.gemspec CHANGED
@@ -5,7 +5,7 @@ require "dogids/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "dogids-cli"
8
- spec.version = "0.0.20"
8
+ spec.version = "0.0.21"
9
9
  spec.authors = ["Jaryd Krishnan"]
10
10
  spec.email = ["jaryd@dogids.com"]
11
11
  spec.summary = "Command line tool for dogIDs tasks"
data/lib/dogids/reload.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require "net/ssh"
1
2
  require "thor"
2
3
  module Dogids
3
4
  class Cli < Thor
@@ -9,8 +10,15 @@ module Dogids
9
10
  def reload(app_name = nil)
10
11
  if yes?("-----> Reload development? [no]")
11
12
  reload_development_machine
13
+ elsif yes?("-----> Restart LAMP stack? [no]")
14
+ ssh_address = get_config_url("dev","dev")
15
+ restart_lamp(ssh_address, "dogids")
16
+ elsif yes?("-----> Restart LB and LAMP stack? [no]")
17
+ restart_all
18
+ elsif yes?("-----> Update Vagrant Box? (NOT RECOMMENDED) [no]")
19
+ update_vagrant_box
12
20
  else
13
- update_vagrant_box if yes?("-----> Update Vagrant Box? (NOT RECOMMENDED) [no]")
21
+ say("Fine, I didn't want you to do anything anyway.")
14
22
  end
15
23
  end
16
24
 
@@ -34,6 +42,33 @@ module Dogids
34
42
  system("cd ~/dogids-vagrant && vagrant reload")
35
43
  end
36
44
 
45
+ # Restarts HAProxy, Apache, HHVM, and MySQL
46
+ def restart_all
47
+ dev_machines = get_config_url("dev")
48
+ dev_machines.each do |key,dev_machine|
49
+ ssh_address = get_config_url("dev",dev_machine)
50
+ lamp_restart_command(dev_machine, "dogids") if dev_machine == dev
51
+ lb_restart_command(dev_machine, "dogids") if dev_machine == lb
52
+ end
53
+ end
54
+
55
+ def restart_lamp(ssh_address,user)
56
+ Net::SSH.start(ssh_address, "dogids") do |ssh|
57
+ lamp_restart_command = "sudo service apache2 restart && sudo service hhvm restart && sudo service mysql restart"
58
+ ssh.exec!(lamp_restart_command) do |_channel, _stream, data|
59
+ print_command(data)
60
+ end
61
+ end
62
+ end
63
+
64
+ def restart_lb(ssh_address,user)
65
+ Net::SSH.start(ssh_address, "dogids") do |ssh|
66
+ lb_restart_command = "sudo service haproxy restart"
67
+ ssh.exec!(lb_restart_command) do |_channel, _stream, data|
68
+ print_command(data)
69
+ end
70
+ end
71
+ end
37
72
  end
38
73
  end
39
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogids-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaryd Krishnan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-28 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh