rain 1.0.5 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +5 -39
  3. data/lib/rain/capistrano.rb +2 -5
  4. data/lib/rain/deployer.rb +4 -10
  5. data/lib/rain/git_tools.rb +8 -2
  6. data/lib/rain/version.rb +1 -1
  7. metadata +36 -221
  8. data/lib/tasks/rain_tasks.rake +0 -5
  9. data/test/dummy/README.rdoc +0 -261
  10. data/test/dummy/Rakefile +0 -7
  11. data/test/dummy/app/assets/javascripts/application.js +0 -15
  12. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  13. data/test/dummy/app/controllers/application_controller.rb +0 -3
  14. data/test/dummy/app/helpers/application_helper.rb +0 -2
  15. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  16. data/test/dummy/config/application.rb +0 -59
  17. data/test/dummy/config/boot.rb +0 -10
  18. data/test/dummy/config/database.yml +0 -23
  19. data/test/dummy/config/environment.rb +0 -5
  20. data/test/dummy/config/environments/development.rb +0 -37
  21. data/test/dummy/config/environments/production.rb +0 -67
  22. data/test/dummy/config/environments/test.rb +0 -37
  23. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  24. data/test/dummy/config/initializers/inflections.rb +0 -15
  25. data/test/dummy/config/initializers/mime_types.rb +0 -5
  26. data/test/dummy/config/initializers/secret_token.rb +0 -7
  27. data/test/dummy/config/initializers/session_store.rb +0 -8
  28. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  29. data/test/dummy/config/locales/en.yml +0 -5
  30. data/test/dummy/config/routes.rb +0 -58
  31. data/test/dummy/config/versions.yml +0 -4
  32. data/test/dummy/config.ru +0 -4
  33. data/test/dummy/db/schema.rb +0 -16
  34. data/test/dummy/public/404.html +0 -26
  35. data/test/dummy/public/422.html +0 -26
  36. data/test/dummy/public/500.html +0 -25
  37. data/test/dummy/public/favicon.ico +0 -0
  38. data/test/dummy/script/rails +0 -6
  39. data/test/rain/config_test.rb +0 -13
  40. data/test/rain/deployer_test.rb +0 -49
  41. data/test/rain/git_tools/release_tag_test.rb +0 -21
  42. data/test/rain/git_tools_test.rb +0 -98
  43. data/test/rain_test.rb +0 -7
  44. data/test/test_helper.rb +0 -35
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 87256ba4f8837766f81c8a4f6c6c0e490d698a09
4
+ data.tar.gz: 143196780cc2ef709801f3e3f7d2ea8cd08dbbfe
5
+ SHA512:
6
+ metadata.gz: d36fd7e8aa4b2b163072b23d926c3087935d69d0c0987d2860d29f5ffbf38ed83df90ebc1f020bc5778eb427df48ba0b9ce81e830b2e9b9609111f596ccc5990
7
+ data.tar.gz: 5e315e76fd89b725d6b28a528718e601bed7ce7f7b32685e1e3c8320c46781352c950405c0b07e8d0044d8564920de0abff63a2aaf656881d2396b417171ca0c
data/Rakefile CHANGED
@@ -1,41 +1,7 @@
1
- #!/usr/bin/env rake
2
- #
3
- # Development tasks
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
4
3
 
5
- begin
6
- require 'bundler/setup'
7
- rescue LoadError
8
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
9
- end
4
+ RSpec::Core::RakeTask.new('spec')
10
5
 
11
- begin
12
- require 'rdoc/task'
13
- rescue LoadError
14
- require 'rdoc/rdoc'
15
- require 'rake/rdoctask'
16
- RDoc::Task = Rake::RDocTask
17
- end
18
-
19
- # Documentation
20
- RDoc::Task.new(:rdoc) do |rdoc|
21
- rdoc.rdoc_dir = 'rdoc'
22
- rdoc.title = 'Rain'
23
- rdoc.options << '--line-numbers'
24
- rdoc.rdoc_files.include('README.rdoc')
25
- rdoc.rdoc_files.include('lib/**/*.rb')
26
- end
27
-
28
- # Gem building
29
- Bundler::GemHelper.install_tasks
30
-
31
- require 'rake/testtask'
32
-
33
- Rake::TestTask.new(:test) do |t|
34
- t.libs << 'lib'
35
- t.libs << 'test'
36
- t.pattern = 'test/**/*_test.rb'
37
- t.verbose = false
38
- end
39
-
40
-
41
- task :default => ['test', 'release']
6
+ # If you want to make this the default task
7
+ task :default => :spec
@@ -7,6 +7,7 @@
7
7
  # deployment to the current ReleaseTag.
8
8
 
9
9
  require 'capistrano'
10
+
10
11
  require 'rain/git_tools'
11
12
 
12
13
  module Rain
@@ -15,11 +16,7 @@ module Rain
15
16
  after "to_production", "to_latest_tag"
16
17
 
17
18
  task :to_latest_tag do
18
- if rails_env == 'stage'
19
- set :branch, GitTools::ReleaseTag.current(rails_env)
20
- else
21
- set :branch, GitTools::ReleaseTag.latest
22
- end
19
+ set :branch, GitTools::ReleaseTag.current(rails_env)
23
20
  end
24
21
  end
25
22
  end
data/lib/rain/deployer.rb CHANGED
@@ -9,17 +9,15 @@ module Rain
9
9
 
10
10
  method_option :force, type: :boolean, desc: "Force a release, do not prompt", aliases: "-f"
11
11
  method_option :"keep-current-version", type: :boolean, desc: "Reuse the previous tag", aliases: "-k"
12
- method_option :patch, default: true, desc: SemanticVersion::PATCH
13
- method_option :minor, default: false, desc: SemanticVersion::MINOR
14
- method_option :major, default: false, desc: SemanticVersion::MAJOR
15
- method_option :smoke, default: false, desc: "Run tests after deployment"
16
-
12
+ method_option :patch, default: true, desc: SemanticVersion::PATCH, type: :boolean
13
+ method_option :minor, default: false, desc: SemanticVersion::MINOR, type: :boolean
14
+ method_option :major, default: false, desc: SemanticVersion::MAJOR, type: :boolean
17
15
  def on environment="production"
18
16
  say "Making it rain on #{environment}..."
19
17
 
20
18
  return unless working_directory_copasetic?(options)
21
19
 
22
- unless options[:"keep-current-version"] or environment == 'production'
20
+ unless options[:"keep-current-version"] || environment == 'production'
23
21
  update_release_tag(environment, tag.to_s)
24
22
  run_cmd("git tag #{tag.to_s}")
25
23
  push_tag(tag)
@@ -37,10 +35,6 @@ module Rain
37
35
 
38
36
  private
39
37
  no_tasks do
40
- def run_smoke_tests
41
- #run Rain.config.smoke_test_command
42
- end
43
-
44
38
  def tag
45
39
  @tag ||= case true
46
40
  when options[:minor] then increment_minor_version
@@ -1,4 +1,5 @@
1
1
  require 'thor'
2
+ require 'yaml'
2
3
  require_relative 'git_tools/release_tag'
3
4
 
4
5
  # A collection of methods and a class, +ReleaseTag+, for querying the
@@ -77,6 +78,7 @@ module GitTools
77
78
  def push_tag(tag)
78
79
  unless tag.nil?
79
80
  run_cmd "git push origin #{tag}"
81
+ raise "Error: Push failed and deploy has been cancelled" if $?.exitstatus > 0
80
82
  end
81
83
  end
82
84
 
@@ -89,7 +91,11 @@ module GitTools
89
91
 
90
92
  # Full path of the versions.yml file in the Rails app.
91
93
  def versions_path
92
- File.expand_path "./config/versions.yml"
94
+ if ENV['RAILS_ENV'] == 'test'
95
+ File.expand_path "./test/dummy/config/versions.yml"
96
+ else
97
+ File.expand_path "./config/versions.yml" # stage, prod, etc.
98
+ end
93
99
  end
94
100
 
95
101
  # A YAML-parsed Hash of the versions.yml file.
@@ -101,7 +107,7 @@ module GitTools
101
107
  # it, and commit/push it to +origin/master+.
102
108
  def update_release_tag(environment, tag)
103
109
  hsh = versions_hash
104
- hsh[environment] = tag
110
+ hsh[environment] = tag.to_s
105
111
  File.write(versions_path, hsh.to_yaml.to_s)
106
112
  run_cmd "git commit -m '[RELEASE][#{environment}] Update release tag for #{environment} to #{tag}' #{versions_path}"
107
113
  run_cmd "git push origin master"
data/lib/rain/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rain
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rain
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.0.5
4
+ version: 1.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tom Scott
@@ -10,173 +9,69 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-12-20 00:00:00.000000000 Z
12
+ date: 2014-05-15 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
- version_requirements: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ~>
19
- - !ruby/object:Gem::Version
20
- version: 3.2.8
21
- none: false
22
- prerelease: false
23
- name: rails
24
- requirement: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - ~>
27
- - !ruby/object:Gem::Version
28
- version: 3.2.8
29
- none: false
30
- type: :runtime
31
- - !ruby/object:Gem::Dependency
32
- version_requirements: !ruby/object:Gem::Requirement
33
- requirements:
34
- - - ! '>='
35
- - !ruby/object:Gem::Version
36
- version: '0'
37
- none: false
38
- prerelease: false
39
15
  name: thor
40
16
  requirement: !ruby/object:Gem::Requirement
41
17
  requirements:
42
- - - ! '>='
18
+ - - '>='
43
19
  - !ruby/object:Gem::Version
44
20
  version: '0'
45
- none: false
46
21
  type: :runtime
47
- - !ruby/object:Gem::Dependency
22
+ prerelease: false
48
23
  version_requirements: !ruby/object:Gem::Requirement
49
24
  requirements:
50
- - - ! '>='
25
+ - - '>='
51
26
  - !ruby/object:Gem::Version
52
27
  version: '0'
53
- none: false
54
- prerelease: false
55
- name: capistrano
28
+ - !ruby/object:Gem::Dependency
29
+ name: activesupport
56
30
  requirement: !ruby/object:Gem::Requirement
57
31
  requirements:
58
- - - ! '>='
32
+ - - '>='
59
33
  - !ruby/object:Gem::Version
60
- version: '0'
61
- none: false
34
+ version: '3.2'
62
35
  type: :runtime
63
- - !ruby/object:Gem::Dependency
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ! '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- none: false
70
36
  prerelease: false
71
- name: minitest
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- none: false
78
- type: :development
79
- - !ruby/object:Gem::Dependency
80
37
  version_requirements: !ruby/object:Gem::Requirement
81
38
  requirements:
82
- - - ! '>='
39
+ - - '>='
83
40
  - !ruby/object:Gem::Version
84
- version: '0'
85
- none: false
86
- prerelease: false
87
- name: guard-minitest
88
- requirement: !ruby/object:Gem::Requirement
89
- requirements:
90
- - - ! '>='
91
- - !ruby/object:Gem::Version
92
- version: '0'
93
- none: false
94
- type: :development
41
+ version: '3.2'
95
42
  - !ruby/object:Gem::Dependency
96
- version_requirements: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - ! '>='
99
- - !ruby/object:Gem::Version
100
- version: '0'
101
- none: false
102
- prerelease: false
103
- name: guard-bundler
43
+ name: rake
104
44
  requirement: !ruby/object:Gem::Requirement
105
45
  requirements:
106
- - - ! '>='
46
+ - - '>='
107
47
  - !ruby/object:Gem::Version
108
48
  version: '0'
109
- none: false
110
49
  type: :development
111
- - !ruby/object:Gem::Dependency
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ! '>='
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
- none: false
118
50
  prerelease: false
119
- name: pg
120
- requirement: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ! '>='
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- none: false
126
- type: :development
127
- - !ruby/object:Gem::Dependency
128
51
  version_requirements: !ruby/object:Gem::Requirement
129
52
  requirements:
130
- - - ! '>='
131
- - !ruby/object:Gem::Version
132
- version: '0'
133
- none: false
134
- prerelease: false
135
- name: mini_specunit
136
- requirement: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ! '>='
53
+ - - '>='
139
54
  - !ruby/object:Gem::Version
140
55
  version: '0'
141
- none: false
142
- type: :development
143
56
  - !ruby/object:Gem::Dependency
144
- version_requirements: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - ! '>='
147
- - !ruby/object:Gem::Version
148
- version: '0'
149
- none: false
150
- prerelease: false
151
- name: mini_shoulda
57
+ name: rspec
152
58
  requirement: !ruby/object:Gem::Requirement
153
59
  requirements:
154
- - - ! '>='
60
+ - - '>='
155
61
  - !ruby/object:Gem::Version
156
62
  version: '0'
157
- none: false
158
63
  type: :development
159
- - !ruby/object:Gem::Dependency
160
- version_requirements: !ruby/object:Gem::Requirement
161
- requirements:
162
- - - ! '>='
163
- - !ruby/object:Gem::Version
164
- version: '0'
165
- none: false
166
64
  prerelease: false
167
- name: jquery-rails
168
- requirement: !ruby/object:Gem::Requirement
65
+ version_requirements: !ruby/object:Gem::Requirement
169
66
  requirements:
170
- - - ! '>='
67
+ - - '>='
171
68
  - !ruby/object:Gem::Version
172
69
  version: '0'
173
- none: false
174
- type: :development
175
- description: ! " Rain is a single-command deployment engine for Rails applications.
176
- It defines a set of conventions for\n deploying the same app version to multiple
177
- servers in multiple environments. Leveraging Git tags, it\n automatically increments
178
- versions according to the Semantic Versioning standard and deploys those versions\n
179
- \ using Capistrano to as many servers and environments as you wish.\"\n"
70
+ description: |2
71
+ Rain is a single-command deployment engine for Rails applications. It defines a set of conventions for
72
+ deploying the same app version to multiple servers in multiple environments. Leveraging Git tags, it
73
+ automatically increments versions according to the Semantic Versioning standard and deploys those versions
74
+ using Capistrano to as many servers and environments as you wish."
180
75
  email:
181
76
  - tom.scott@elocal.com
182
77
  executables:
@@ -184,122 +79,42 @@ executables:
184
79
  extensions: []
185
80
  extra_rdoc_files: []
186
81
  files:
82
+ - LICENSE.md
83
+ - README.md
84
+ - Rakefile
85
+ - bin/rain
86
+ - lib/generators/rain/install/USAGE
187
87
  - lib/generators/rain/install/install_generator.rb
188
88
  - lib/generators/rain/install/templates/versions.yml
189
- - lib/generators/rain/install/USAGE
89
+ - lib/rain.rb
190
90
  - lib/rain/capistrano.rb
191
91
  - lib/rain/config.rb
192
92
  - lib/rain/deployer.rb
193
- - lib/rain/git_tools/release_tag.rb
194
93
  - lib/rain/git_tools.rb
94
+ - lib/rain/git_tools/release_tag.rb
195
95
  - lib/rain/semantic_version.rb
196
96
  - lib/rain/version.rb
197
- - lib/rain.rb
198
- - lib/tasks/rain_tasks.rake
199
- - LICENSE.md
200
- - Rakefile
201
- - README.md
202
- - test/dummy/app/assets/javascripts/application.js
203
- - test/dummy/app/assets/stylesheets/application.css
204
- - test/dummy/app/controllers/application_controller.rb
205
- - test/dummy/app/helpers/application_helper.rb
206
- - test/dummy/app/views/layouts/application.html.erb
207
- - test/dummy/config/application.rb
208
- - test/dummy/config/boot.rb
209
- - test/dummy/config/database.yml
210
- - test/dummy/config/environment.rb
211
- - test/dummy/config/environments/development.rb
212
- - test/dummy/config/environments/production.rb
213
- - test/dummy/config/environments/test.rb
214
- - test/dummy/config/initializers/backtrace_silencers.rb
215
- - test/dummy/config/initializers/inflections.rb
216
- - test/dummy/config/initializers/mime_types.rb
217
- - test/dummy/config/initializers/secret_token.rb
218
- - test/dummy/config/initializers/session_store.rb
219
- - test/dummy/config/initializers/wrap_parameters.rb
220
- - test/dummy/config/locales/en.yml
221
- - test/dummy/config/routes.rb
222
- - test/dummy/config/versions.yml
223
- - test/dummy/config.ru
224
- - test/dummy/db/schema.rb
225
- - test/dummy/public/404.html
226
- - test/dummy/public/422.html
227
- - test/dummy/public/500.html
228
- - test/dummy/public/favicon.ico
229
- - test/dummy/Rakefile
230
- - test/dummy/README.rdoc
231
- - test/dummy/script/rails
232
- - test/rain/config_test.rb
233
- - test/rain/deployer_test.rb
234
- - test/rain/git_tools/release_tag_test.rb
235
- - test/rain/git_tools_test.rb
236
- - test/rain_test.rb
237
- - test/test_helper.rb
238
- - bin/rain
239
97
  homepage: http://github.com/eLocal/rain
240
98
  licenses: []
99
+ metadata: {}
241
100
  post_install_message:
242
101
  rdoc_options: []
243
102
  require_paths:
244
103
  - lib
245
104
  required_ruby_version: !ruby/object:Gem::Requirement
246
105
  requirements:
247
- - - ! '>='
106
+ - - '>='
248
107
  - !ruby/object:Gem::Version
249
108
  version: '0'
250
- segments:
251
- - 0
252
- hash: 1880194166875685730
253
- none: false
254
109
  required_rubygems_version: !ruby/object:Gem::Requirement
255
110
  requirements:
256
- - - ! '>='
111
+ - - '>='
257
112
  - !ruby/object:Gem::Version
258
113
  version: '0'
259
- segments:
260
- - 0
261
- hash: 1880194166875685730
262
- none: false
263
114
  requirements: []
264
115
  rubyforge_project:
265
- rubygems_version: 1.8.24
116
+ rubygems_version: 2.2.2
266
117
  signing_key:
267
- specification_version: 3
118
+ specification_version: 4
268
119
  summary: Rain is a single-command deployment engine for Rails applications.
269
- test_files:
270
- - test/dummy/app/assets/javascripts/application.js
271
- - test/dummy/app/assets/stylesheets/application.css
272
- - test/dummy/app/controllers/application_controller.rb
273
- - test/dummy/app/helpers/application_helper.rb
274
- - test/dummy/app/views/layouts/application.html.erb
275
- - test/dummy/config/application.rb
276
- - test/dummy/config/boot.rb
277
- - test/dummy/config/database.yml
278
- - test/dummy/config/environment.rb
279
- - test/dummy/config/environments/development.rb
280
- - test/dummy/config/environments/production.rb
281
- - test/dummy/config/environments/test.rb
282
- - test/dummy/config/initializers/backtrace_silencers.rb
283
- - test/dummy/config/initializers/inflections.rb
284
- - test/dummy/config/initializers/mime_types.rb
285
- - test/dummy/config/initializers/secret_token.rb
286
- - test/dummy/config/initializers/session_store.rb
287
- - test/dummy/config/initializers/wrap_parameters.rb
288
- - test/dummy/config/locales/en.yml
289
- - test/dummy/config/routes.rb
290
- - test/dummy/config/versions.yml
291
- - test/dummy/config.ru
292
- - test/dummy/db/schema.rb
293
- - test/dummy/public/404.html
294
- - test/dummy/public/422.html
295
- - test/dummy/public/500.html
296
- - test/dummy/public/favicon.ico
297
- - test/dummy/Rakefile
298
- - test/dummy/README.rdoc
299
- - test/dummy/script/rails
300
- - test/rain/config_test.rb
301
- - test/rain/deployer_test.rb
302
- - test/rain/git_tools/release_tag_test.rb
303
- - test/rain/git_tools_test.rb
304
- - test/rain_test.rb
305
- - test/test_helper.rb
120
+ test_files: []
@@ -1,5 +0,0 @@
1
- namespace :rain do
2
- task :wiki do
3
- puts "This will download the wiki submodule to doc/wiki"
4
- end
5
- end