capper 0.9.17 → 0.9.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -71,7 +71,7 @@ _cset(:current_revision) { capture("cat #{current_path}/REVISION", :except
71
71
  _cset(:latest_revision) { capture("cat #{current_release}/REVISION", :except => { :no_release => true }).chomp }
72
72
  _cset(:previous_revision) { capture("cat #{previous_release}/REVISION", :except => { :no_release => true }).chomp if previous_release }
73
73
 
74
- set(:internal_shared_children, fetch(:internal_shared_children, []) | %w(cache config log pids))
74
+ set(:internal_shared_children, fetch(:internal_shared_children, []) | %w(cache config log pids system))
75
75
 
76
76
  # some tasks, like symlink, need to always point at the latest release, but
77
77
  # they can also (occassionally) be called standalone. In the standalone case,
@@ -440,10 +440,10 @@ namespace :deploy do
440
440
  reason = ENV['REASON']
441
441
  deadline = ENV['UNTIL']
442
442
 
443
- template = File.read(File.join(File.dirname(__FILE__), "templates", "maintenance.rhtml"))
444
- result = ERB.new(template).result(binding)
445
-
446
- put result, "#{shared_path}/system/#{maintenance_basename}.html", :mode => 0644
443
+ upload_template_file("maintenance.html",
444
+ "#{shared_path}/system/#{maintenance_basename}.html",
445
+ :mode => 0644,
446
+ :binding => binding)
447
447
  end
448
448
 
449
449
  desc <<-DESC
@@ -5,7 +5,7 @@ _cset(:rails_env, "production")
5
5
  _cset(:asset_pipeline, true)
6
6
  _cset(:asset_env, "RAILS_GROUPS=assets")
7
7
 
8
- set(:internal_shared_children, fetch(:internal_shared_children, []) | %w(assets cache system))
8
+ set(:internal_shared_children, fetch(:internal_shared_children, []) | %w(assets))
9
9
 
10
10
  set(:internal_symlinks, fetch(:internal_symlinks, {}).merge({
11
11
  "cache" => "tmp/cache",
@@ -0,0 +1,52 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
8
+ <title>System down for maintenance</title>
9
+
10
+ <style type="text/css">
11
+ div.outer {
12
+ position: absolute;
13
+ left: 50%;
14
+ top: 50%;
15
+ width: 500px;
16
+ height: 300px;
17
+ margin-left: -260px;
18
+ margin-top: -150px;
19
+ }
20
+
21
+ .DialogBody {
22
+ margin: 0;
23
+ padding: 10px;
24
+ text-align: left;
25
+ border: 1px solid #ccc;
26
+ border-right: 1px solid #999;
27
+ border-bottom: 1px solid #999;
28
+ background-color: #fff;
29
+ }
30
+
31
+ body { background-color: #fff; }
32
+ </style>
33
+ </head>
34
+
35
+ <body>
36
+
37
+ <div class="outer">
38
+ <div class="DialogBody" style="text-align: center;">
39
+ <div style="text-align: center; width: 200px; margin: 0 auto;">
40
+ <p style="color: red; font-size: 16px; line-height: 20px;">
41
+ The system is down for <%= reason ? reason : "maintenance" %>
42
+ as of <%= Time.now.strftime("%H:%M %Z") %>.
43
+ </p>
44
+ <p style="color: #666;">
45
+ It'll be back <%= deadline ? deadline : "shortly" %>.
46
+ </p>
47
+ </div>
48
+ </div>
49
+ </div>
50
+
51
+ </body>
52
+ </html>
@@ -25,6 +25,8 @@ module Capper
25
25
  end
26
26
 
27
27
  def upload_template(path, options={})
28
+ bnd = options.delete(:binding) || binding
29
+
28
30
  if task = current_task
29
31
  servers = find_servers_for_task(task, options)
30
32
  else
@@ -37,7 +39,7 @@ module Capper
37
39
 
38
40
  servers.each do |server|
39
41
  erb = Erubis::Eruby.new(yield server)
40
- result = erb.result(binding())
42
+ result = erb.result(bnd)
41
43
  put(result, path, options.merge!(:hosts => server))
42
44
  end
43
45
  end
@@ -1,3 +1,3 @@
1
1
  module Capper
2
- VERSION = "0.9.17"
2
+ VERSION = "0.9.18"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.17
4
+ version: 0.9.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-10 00:00:00.000000000 Z
12
+ date: 2012-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubis
16
- requirement: &9826760 !ruby/object:Gem::Requirement
16
+ requirement: &7852580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *9826760
24
+ version_requirements: *7852580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: capistrano
27
- requirement: &9826160 !ruby/object:Gem::Requirement
27
+ requirement: &7851980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.9.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *9826160
35
+ version_requirements: *7851980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: capistrano_colors
38
- requirement: &9825600 !ruby/object:Gem::Requirement
38
+ requirement: &7851400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.5.5
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *9825600
46
+ version_requirements: *7851400
47
47
  description: Capper is a collection of opinionated Capistrano recipes
48
48
  email:
49
49
  - bb@xnull.de
@@ -74,6 +74,7 @@ files:
74
74
  - lib/capper/ruby.rb
75
75
  - lib/capper/rvm.rb
76
76
  - lib/capper/templates/delayed_job.sh.erb
77
+ - lib/capper/templates/maintenance.html.erb
77
78
  - lib/capper/templates/manage.py.erb
78
79
  - lib/capper/templates/rails.console.sh.erb
79
80
  - lib/capper/templates/resque.sh.erb