champagne 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ .bundle
3
+ .DS_Store
4
+ Gemfile.lock
5
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in champagne.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Champagne
2
+
3
+ *
4
+ *
5
+ Champagne * * []
6
+ The fastest way to get code into production _* *_ ||
7
+ |*| |*| |* |
8
+ |_| |_| |__|
9
+ \*/ \*/ | *|
10
+ _|_ _|_ |__|
11
+
12
+ Champagne is a server that quite simply runs long-running terminal commands reliably. Chain these commands together and you can build a workflow that tests code and moves it to production.
13
+
14
+ In the end, you get to pop the cork more often on a bottle of bubbly to celebrate each deploy to production.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/champagne.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "champagne/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "champagne"
7
+ s.version = Champagne::VERSION
8
+ s.authors = ["Brad Gessler"]
9
+ s.email = ["brad@bradgessler.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{The fastest way to get code into production }
12
+ s.description = %q{Champagne is a server that quite simply runs long-running terminal commands reliably. Chain these commands together and you can build a workflow that tests code and moves it to production.}
13
+
14
+ s.rubyforge_project = "champagne"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ s.add_development_dependency "thin"
23
+ s.add_runtime_dependency "sinatra"
24
+ s.add_runtime_dependency "eventmachine"
25
+ end
data/champagne.rb ADDED
@@ -0,0 +1,35 @@
1
+ require "champagne/version"
2
+
3
+ module Champagne
4
+ # Open up a connecton to console and stream the output. When the process is killed,
5
+ # we shut down the stream.
6
+ class Console < EventMachine::Connection
7
+ attr_accessor :stream
8
+
9
+ def initialize(stream)
10
+ @stream = stream
11
+ end
12
+
13
+ def receive_data(data)
14
+ stream << data
15
+ end
16
+
17
+ def unbind
18
+ stream.close
19
+ end
20
+
21
+ def self.exec(cmd, stream)
22
+ EM.popen cmd, self, stream
23
+ end
24
+ end
25
+
26
+ require 'sinatra/base'
27
+
28
+ class App < Sinatra::Base
29
+ get '/' do
30
+ stream(:keep_open) do |out|
31
+ Console.exec "sudo -u bgessler sh -c 'cd /Users/bgessler/Projects/poll_everywhere/web && pwd && rbenv local && bundle cap deploy'", out
32
+ end
33
+ end
34
+ end
35
+ end
data/config.ru ADDED
@@ -0,0 +1,5 @@
1
+ # bundle exec thin -R config.ru start
2
+ require 'rubygems'
3
+ require 'champagne'
4
+
5
+ run Champagne::App
data/lib/champagne.rb ADDED
@@ -0,0 +1,35 @@
1
+ require "champagne/version"
2
+
3
+ module Champagne
4
+ # Open up a connecton to console and stream the output. When the process is killed,
5
+ # we shut down the stream.
6
+ class Console < EventMachine::Connection
7
+ attr_accessor :stream
8
+
9
+ def initialize(stream)
10
+ @stream = stream
11
+ end
12
+
13
+ def receive_data(data)
14
+ stream << data
15
+ end
16
+
17
+ def unbind
18
+ stream.close
19
+ end
20
+
21
+ def self.exec(cmd, stream)
22
+ EM.popen cmd, self, stream
23
+ end
24
+ end
25
+
26
+ require 'sinatra/base'
27
+
28
+ class App < Sinatra::Base
29
+ get '/' do
30
+ stream(:keep_open) do |out|
31
+ Console.exec "sh -c 'ls -al'", out
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ module Champagne
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: champagne
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brad Gessler
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-10-20 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: thin
16
+ requirement: &70198914363520 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70198914363520
25
+ - !ruby/object:Gem::Dependency
26
+ name: sinatra
27
+ requirement: &70198914356940 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70198914356940
36
+ - !ruby/object:Gem::Dependency
37
+ name: eventmachine
38
+ requirement: &70198914356520 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70198914356520
47
+ description: Champagne is a server that quite simply runs long-running terminal commands
48
+ reliably. Chain these commands together and you can build a workflow that tests
49
+ code and moves it to production.
50
+ email:
51
+ - brad@bradgessler.com
52
+ executables: []
53
+ extensions: []
54
+ extra_rdoc_files: []
55
+ files:
56
+ - .gitignore
57
+ - Gemfile
58
+ - README.md
59
+ - Rakefile
60
+ - champagne.gemspec
61
+ - champagne.rb
62
+ - config.ru
63
+ - lib/champagne.rb
64
+ - lib/champagne/version.rb
65
+ homepage: ''
66
+ licenses: []
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project: champagne
85
+ rubygems_version: 1.8.10
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: The fastest way to get code into production
89
+ test_files: []