escualo 0.2.6 → 0.2.7

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
  SHA1:
3
- metadata.gz: 432ee25813d9e628b9ee1dcd7854f6c5f4ad26fd
4
- data.tar.gz: fa4492ebbe50f6e552d8b6a3750c46248da78bf0
3
+ metadata.gz: 5446d3c1f0bdafa1c8a866f41b52b90964a28c9f
4
+ data.tar.gz: fd2a635ebd0d6a171ef3573a2b4d7d42b0499bf6
5
5
  SHA512:
6
- metadata.gz: 1a0a3c01d37d9eaf25cf86a3379985994e4f976cf419c8ad7152d74e40a64980e6b5415e84cdc1435e5d0ca6dd100903db162b27dcc49acfc149d9733587da83
7
- data.tar.gz: 51c6aaa54956684835e5b982ce40522c2635b1b9a501a054120626882b16148ef2cfb5c0966f481285d4d48d30d822b0f7b20060f0e627698b7dec1cbba81c8e
6
+ metadata.gz: 801cec7433ec4dc70fe695f58ae5eb7181b7ca9ad9e9b5cf6744779577f7a3ddedf20b25cad535ae8f46652e8b3a223014e9859a3263151db7b65b7cb42ed98b
7
+ data.tar.gz: 184a0ce50ccbfb7ae7c2abecd4b1040ac6915ae03056d1c03a37c5e3c24f030d379be3fc42ad661c74d7a91f2f5fa0c9bc13925b2acd83ec7d8fdfcb8a5a755b
@@ -53,7 +53,7 @@ command 'artifact create service' do |c|
53
53
  end
54
54
 
55
55
  step 'Configuring monit...' do
56
- Escualo::Artifact.configure_monit ssh, name
56
+ Escualo::Artifact.configure_monit ssh, name: name, port: port
57
57
  end
58
58
 
59
59
  step 'Creating push infrastructure' do
@@ -53,9 +53,10 @@ module Escualo
53
53
  ssh.exec! "chmod +x #{hook_file}"
54
54
  end
55
55
 
56
- def self.configure_monit(ssh, name)
56
+ def self.configure_monit(ssh, options)
57
+ name = options[:name]
57
58
  ssh.exec! 'mkdir -p /etc/monit/conf.d/'
58
- ssh.upload_template! "/etc/monit/conf.d/escualo-#{name}", 'monit.conf', name: name
59
+ ssh.upload_template! "/etc/monit/conf.d/escualo-#{name}", 'monit.conf', options
59
60
  ssh.exec! 'monit reload'
60
61
  end
61
62
 
@@ -43,9 +43,9 @@ module Escualo
43
43
  cp monit-#{options.monit_version}/bin/monit /usr/bin/monit
44
44
  ln -s /etc/monit/monitrc /etc/monitrc
45
45
  service monit start
46
- 'set httpd port 2812 and' > /etc/monit/conf.d/web-server
47
- ' allow 0.0.0.0/0.0.0.0' >> /etc/monit/conf.d/web-server
48
- ' allow admin:#{options.monit_password}' >> /etc/monit/conf.d/web-server
46
+ echo 'set httpd port 2812 and' > /etc/monit/conf.d/web-server
47
+ echo ' allow 0.0.0.0/0.0.0.0' >> /etc/monit/conf.d/web-server
48
+ echo ' allow admin:#{options.monit_password}' >> /etc/monit/conf.d/web-server
49
49
  monit reload
50
50
  }, options
51
51
  end
data/lib/escualo/env.rb CHANGED
@@ -26,7 +26,12 @@ module Escualo
26
26
  end
27
27
 
28
28
  def self.present?(ssh, variable)
29
- ssh.exec!("cat ~/.escualo/vars/#{variable}").present?
29
+ value = get(ssh, variable)
30
+ value.present? && !value.include?('No such file or directory')
31
+ end
32
+
33
+ def self.get(ssh, variable)
34
+ ssh.exec!("cat ~/.escualo/vars/#{variable}")
30
35
  end
31
36
 
32
37
  def self.set(ssh, variables)
@@ -1,4 +1,4 @@
1
1
  module Escualo
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  BASE_VERSION = '3.1'
4
4
  end
@@ -1,11 +1,10 @@
1
- check host escualo-<%= @name %> with address $HOST
2
- start "/sbin/start <%= @name %>"
3
- stop "/sbin/stop <%= @name %>"
1
+ check host escualo-<%= name %> with address localhost
2
+ start "/sbin/start <%= name %>"
3
+ stop "/sbin/stop <%= name %>"
4
4
  if failed
5
- port $PORT
5
+ port <%= port %>
6
6
  protocol HTTP
7
7
  request "/"
8
8
  status > 199
9
9
  with timeout 30 seconds
10
- then restart
11
- EOF
10
+ then restart
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escualo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli