shuttle-deploy 0.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +25 -0
  3. data/.magnum.yml +1 -0
  4. data/.rspec +2 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +18 -0
  7. data/README.md +230 -0
  8. data/Rakefile +10 -0
  9. data/bin/shuttle +60 -0
  10. data/examples/rails.yml +22 -0
  11. data/examples/static.yml +10 -0
  12. data/examples/wordpress.yml +34 -0
  13. data/lib/shuttle/config.rb +5 -0
  14. data/lib/shuttle/deploy.rb +58 -0
  15. data/lib/shuttle/deployment/nodejs.rb +48 -0
  16. data/lib/shuttle/deployment/php.rb +17 -0
  17. data/lib/shuttle/deployment/rails.rb +116 -0
  18. data/lib/shuttle/deployment/ruby.rb +40 -0
  19. data/lib/shuttle/deployment/static.rb +5 -0
  20. data/lib/shuttle/deployment/wordpress/cli.rb +27 -0
  21. data/lib/shuttle/deployment/wordpress/core.rb +50 -0
  22. data/lib/shuttle/deployment/wordpress/plugins.rb +112 -0
  23. data/lib/shuttle/deployment/wordpress/vip.rb +84 -0
  24. data/lib/shuttle/deployment/wordpress.rb +191 -0
  25. data/lib/shuttle/errors.rb +5 -0
  26. data/lib/shuttle/helpers.rb +50 -0
  27. data/lib/shuttle/runner.rb +153 -0
  28. data/lib/shuttle/session.rb +52 -0
  29. data/lib/shuttle/support/bundler.rb +45 -0
  30. data/lib/shuttle/support/foreman.rb +7 -0
  31. data/lib/shuttle/support/thin.rb +59 -0
  32. data/lib/shuttle/target.rb +23 -0
  33. data/lib/shuttle/tasks.rb +264 -0
  34. data/lib/shuttle/version.rb +3 -0
  35. data/lib/shuttle.rb +35 -0
  36. data/shuttle-deploy.gemspec +28 -0
  37. data/spec/deploy_spec.rb +4 -0
  38. data/spec/fixtures/.gitkeep +0 -0
  39. data/spec/fixtures/static.yml +11 -0
  40. data/spec/helpers_spec.rb +42 -0
  41. data/spec/spec_helper.rb +15 -0
  42. data/spec/target_spec.rb +41 -0
  43. metadata +232 -0
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+
3
+ describe Shuttle::Helpers do
4
+ class Klass ; include Shuttle::Helpers ; end
5
+ let(:subject) { Klass.new }
6
+
7
+ it { should respond_to :log }
8
+ it { should respond_to :error }
9
+ it { should respond_to :git_installed? }
10
+ it { should respond_to :svn_installed? }
11
+ it { should respond_to :release_exists? }
12
+ it { should respond_to :stream_output }
13
+
14
+ describe '#log' do
15
+ it 'prints a formatted message' do
16
+ STDOUT.should_receive(:puts).with("\e[1m\e[32m----->\e[0m message")
17
+ subject.log('message')
18
+ end
19
+ end
20
+
21
+ describe '#error' do
22
+ it 'prints an error message' do
23
+ STDOUT.should_receive(:puts).with("\e[1m\e[31m----->\e[0m ERROR: message")
24
+ expect { subject.error('message') }.to raise_error Shuttle::DeployError
25
+ end
26
+
27
+ it 'raises a deploy error' do
28
+ STDOUT.stub(:puts)
29
+ expect { subject.error('message') }.to raise_error Shuttle::DeployError, 'message'
30
+ end
31
+ end
32
+
33
+ describe '#stream_output' do
34
+ let(:string) { "line1\nline2\nline3\n\n" }
35
+
36
+ it 'prints a formatted string' do
37
+ result = " line1\n line2\n line3"
38
+ STDOUT.should_receive(:puts).with(result)
39
+ subject.stream_output(string)
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,15 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
3
+
4
+ $:.unshift File.expand_path("../..", __FILE__)
5
+
6
+ require 'lib/shuttle'
7
+
8
+ def fixture_path(filename=nil)
9
+ path = File.expand_path("../fixtures", __FILE__)
10
+ filename.nil? ? path : File.join(path, filename)
11
+ end
12
+
13
+ def fixture(file)
14
+ File.read(File.join(fixture_path, file))
15
+ end
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+
3
+ describe Shuttle::Target do
4
+ describe '#connection' do
5
+ subject do
6
+ Shuttle::Target.new(
7
+ :host => 'host.com',
8
+ :user => 'user',
9
+ :password => 'password'
10
+ )
11
+ end
12
+
13
+ it 'returns a new ssh session connection' do
14
+ subject.connection.should be_a Net::SSH::Session
15
+ end
16
+ end
17
+
18
+ describe '#validate!' do
19
+ subject { Shuttle::Target.new(attributes) }
20
+
21
+ context 'with valid attributes' do
22
+ let(:attributes) do
23
+ {:host => 'host.com', :user => 'user', :deploy_to => '/home'}
24
+ end
25
+
26
+ it 'does not raise errors' do
27
+ expect { subject.validate! }.not_to raise_error
28
+ end
29
+ end
30
+
31
+ context 'with incomplete attributes' do
32
+ let(:attributes) do
33
+ {:host => 'host.com', :user => 'user'}
34
+ end
35
+
36
+ it 'raises error' do
37
+ expect { subject.validate! }.to raise_error Shuttle::ConfigError, "Deploy path required"
38
+ end
39
+ end
40
+ end
41
+ end
metadata ADDED
@@ -0,0 +1,232 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shuttle-deploy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0.beta1
5
+ platform: ruby
6
+ authors:
7
+ - Dan Sosedoff
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '2.13'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '2.13'
41
+ - !ruby/object:Gem::Dependency
42
+ name: simplecov
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.7'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: net-ssh
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.6'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '2.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: net-ssh-session
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '0.1'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '0.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: terminal_helpers
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '0.1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '0.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: chronic_duration
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '0.9'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '0.9'
111
+ - !ruby/object:Gem::Dependency
112
+ name: hashr
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 0.0.22
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: 0.0.22
125
+ - !ruby/object:Gem::Dependency
126
+ name: safe_yaml
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: '0.9'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: '0.9'
139
+ - !ruby/object:Gem::Dependency
140
+ name: toml
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: '0.0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ~>
151
+ - !ruby/object:Gem::Version
152
+ version: '0.0'
153
+ description: Minimalistic deployment tool for small and one-server applications
154
+ email:
155
+ - dan.sosedoff@gmail.com
156
+ executables:
157
+ - shuttle
158
+ extensions: []
159
+ extra_rdoc_files: []
160
+ files:
161
+ - .gitignore
162
+ - .magnum.yml
163
+ - .rspec
164
+ - Gemfile
165
+ - LICENSE
166
+ - README.md
167
+ - Rakefile
168
+ - bin/shuttle
169
+ - examples/rails.yml
170
+ - examples/static.yml
171
+ - examples/wordpress.yml
172
+ - lib/shuttle.rb
173
+ - lib/shuttle/config.rb
174
+ - lib/shuttle/deploy.rb
175
+ - lib/shuttle/deployment/nodejs.rb
176
+ - lib/shuttle/deployment/php.rb
177
+ - lib/shuttle/deployment/rails.rb
178
+ - lib/shuttle/deployment/ruby.rb
179
+ - lib/shuttle/deployment/static.rb
180
+ - lib/shuttle/deployment/wordpress.rb
181
+ - lib/shuttle/deployment/wordpress/cli.rb
182
+ - lib/shuttle/deployment/wordpress/core.rb
183
+ - lib/shuttle/deployment/wordpress/plugins.rb
184
+ - lib/shuttle/deployment/wordpress/vip.rb
185
+ - lib/shuttle/errors.rb
186
+ - lib/shuttle/helpers.rb
187
+ - lib/shuttle/runner.rb
188
+ - lib/shuttle/session.rb
189
+ - lib/shuttle/support/bundler.rb
190
+ - lib/shuttle/support/foreman.rb
191
+ - lib/shuttle/support/thin.rb
192
+ - lib/shuttle/target.rb
193
+ - lib/shuttle/tasks.rb
194
+ - lib/shuttle/version.rb
195
+ - shuttle-deploy.gemspec
196
+ - spec/deploy_spec.rb
197
+ - spec/fixtures/.gitkeep
198
+ - spec/fixtures/static.yml
199
+ - spec/helpers_spec.rb
200
+ - spec/spec_helper.rb
201
+ - spec/target_spec.rb
202
+ homepage: https://github.com/sosedoff/shuttle
203
+ licenses: []
204
+ metadata: {}
205
+ post_install_message:
206
+ rdoc_options: []
207
+ require_paths:
208
+ - lib
209
+ required_ruby_version: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - ! '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ required_rubygems_version: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - ! '>'
217
+ - !ruby/object:Gem::Version
218
+ version: 1.3.1
219
+ requirements: []
220
+ rubyforge_project:
221
+ rubygems_version: 2.0.3
222
+ signing_key:
223
+ specification_version: 4
224
+ summary: Minimalistic deployment tool
225
+ test_files:
226
+ - spec/deploy_spec.rb
227
+ - spec/fixtures/.gitkeep
228
+ - spec/fixtures/static.yml
229
+ - spec/helpers_spec.rb
230
+ - spec/spec_helper.rb
231
+ - spec/target_spec.rb
232
+ has_rdoc: