Skip to content
Browse files

removed skypemac gem until we can figure out how to not install it on…

… rof/staging/prod
  • Loading branch information...
1 parent 785e47d commit 7c29c29ccda5deacdcfea2845fb125b7ec9f4750 @jimarnold jimarnold committed Aug 23, 2012
Showing with 33 additions and 18 deletions.
  1. +0 −4 Gemfile
  2. +0 −4 Gemfile.lock
  3. +1 −1 railsonfire.yml
  4. +1 −1 script/check_build.rb
  5. +31 −8 script/check_site.rb
View
4 Gemfile
@@ -54,10 +54,6 @@ group :test, :development do
gem "jslint_on_rails"
end
-group :ignore_on_rof do
- gem 'skypemac'
-end
-
gem 'simplecov', :require => false, :group => :test
gem 'newrelic_rpm'
View
4 Gemfile.lock
@@ -206,7 +206,6 @@ GEM
thor (~> 0.14.6)
raindrops (0.10.0)
rake (0.9.2.2)
- rb-appscript (0.6.1)
rdoc (3.12)
json (~> 1.4)
redis (3.0.1)
@@ -272,8 +271,6 @@ GEM
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
- skypemac (0.0.1)
- rb-appscript
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -348,7 +345,6 @@ DEPENDENCIES
simple-random
simple_form
simplecov
- skypemac
truncate_html
uglifier (>= 1.0.3)
unicorn
View
2 railsonfire.yml
@@ -1,7 +1,7 @@
id: 164da6d0-6c66-012f-a3f5-12313d2df0b0
setup:
commands:
- - bundle install --without development production ignore_on_rof
+ - bundle install --without development production
- bundle exec rake db:migrate
test:
commands:
View
2 script/check_build.rb
@@ -21,7 +21,7 @@ def demonize
rof_user = ENV['ROF_USER']
rof_password = ENV['ROF_PASSWORD']
-
+
raise "You need to set ROF_USER and ROF_PASSWORD env vars" if !rof_user || !rof_password
begin
View
39 script/check_site.rb
@@ -1,3 +1,5 @@
+require 'daemons'
+
def broadcast_on_skype message
require 'skypemac'
vkchat = SkypeMac::Chat.recent_chats.find {|c|c.topic == "VictoryKit Chat"}
@@ -8,13 +10,34 @@ def broadcast_on_skype message
end
end
-while true
- status = `curl --head -s act.watchdog.net | awk 'NR==1{print $2}'`
- status.strip!
- if status != '200'
- broadcast_on_skype "hey idiots, the site is broken"
+def start
+ demonize
+ log("site checker is now started")
+end
+
+def stop
+ demonize
+ log "site checker is now stopped"
+end
+
+def demonize
+ Daemons.run_proc('check_site', :dir_mode => :normal, :dir => '/var/tmp/', :monitor => false) do
+ while true
+ status = `curl --head -s act.watchdog.net | awk 'NR==1{print $2}'`
+ status.strip!
+ if status == '500'
+ broadcast_on_skype "hey idiots, the site is broken"
+ end
+ sleep 60
+ end
end
- print "Received #{status} from act.watchdog.net\r"
- $stdout.flush
- sleep 60
+end
+
+case ARGV[0]
+ when 'start'
+ start
+ when 'stop'
+ stop
+ else
+ puts "usage: check_build start|stop"
end

0 comments on commit 7c29c29

Please sign in to comment.
Something went wrong with that request. Please try again.