Skip to content

Instantly share code, notes, and snippets.

View ezmobius's full-sized avatar

Ezra Zygmuntowicz ezmobius

View GitHub Profile
diff --git a/lib/chef-deploy/cached_deploy.rb b/lib/chef-deploy/cached_deploy.rb
index f9ea7b4..9226497 100644
--- a/lib/chef-deploy/cached_deploy.rb
+++ b/lib/chef-deploy/cached_deploy.rb
@@ -11,6 +11,7 @@ class CachedDeploy
if @configuration[:revision] == ''
@configuration[:revision] = source.query_revision(@configuration[:branch]) {|cmd| ru
end
+ return if check_current_revision_and_noop_if_same(@configuration[:revision])
Chef::Log.info "deploying branch: #{@configuration[:branch]} rev: #{@configuration[:rev
# JSON
{
"applications": [
{
"foobar": {
"migration_command": "rake db:migrate",
"branch": "HEAD",
"deploy_action": "deploy",
"framework_env": "production",
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
echo succeeded
chmod 600 ${SSH_ENV}
. ${SSH_ENV} > /dev/null
/usr/bin/ssh-add;
}
#!/usr/bin/env ruby
# solo.rb
def usage(message)
$stderr.puts message
$stderr.puts
$stderr.puts "#{File.basename($0)} envname [migrate]"
exit 1
end
class Chef
class Resource
class ManagedTemplate < Template
def initialize(name, collection=nil, node=nil)
super(name, collection, node)
not_if { ::File.exists?(name.sub(/(.*)(\/)/, '\1/noclobber.')) }
end
end
end
end
diff --git a/app/controllers/reporting.rb b/app/controllers/reporting.rb
index 3a6768f..662bdd9 100644
--- a/app/controllers/reporting.rb
+++ b/app/controllers/reporting.rb
@@ -24,34 +24,6 @@ class Reporting < Application
if instance.status == :running
Merb.logger.error! "instance(#{instance.amazon_id}) ALERT!\n SEVERITY: #{params[:data]['Severity']}\n PLUGIN:#{params[:data]['Plugin']} TYPE:#{params[:data]['Type']}\n MESSAGE:#{params[:data]['alert_message']}"
Alert.create_from_json(instance, params['data'])
- environment = Environment.get instance.environment.id
- if environment.alerting_enabled
# /etc/ey-alerts.json
{"skip":[
"mysqld"
],
"check":[
"ttsrv"
]}
== re-grid
the RabbitMq Elastic Grid
<head node>
<head agent>
<rabbitmq broker>
<worker node>
<worker agent>
<worker agent>
upstream unicorn {
server unix:/data/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
~/rubinius > bin/rbx
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'redis'
=> true
irb(main):003:0> r = Redis.new
=> #<Redis:0x724 @opts={:db=>0, :port=>"6379", :host=>"localhost"} @db=0 @server=<Redis::Server: localhost:6379 (NOT CONNECTED)>>
irb(main):004:0> r['foo'] = 'bar'
=> "bar"
irb(main):005:0> r['foo']