thunder_punch 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/recipes/deployment/deployment.rb +36 -7
- data/lib/recipes/deployment/passenger.rb +1 -1
- data/lib/recipes/sass/compile.rb +12 -0
- data/lib/recipes/sass.rb +3 -0
- data/lib/recipes/varnish/cache.rb +12 -0
- data/lib/recipes/varnish.rb +3 -0
- data/thunder_punch.gemspec +6 -2
- metadata +7 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
@@ -1,10 +1,13 @@
|
|
1
1
|
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
|
3
|
+
#finalizing deploy is normal behaviour but in some (multi-server) environments we don't want that.
|
4
|
+
_cset :finalize_deploy, true
|
5
|
+
|
2
6
|
namespace :deploy do
|
3
7
|
desc "Deploy the app"
|
4
8
|
task :default, :roles => [:app, :static, :worker] do
|
5
9
|
update
|
6
10
|
restart
|
7
|
-
cleanup
|
8
11
|
end
|
9
12
|
|
10
13
|
desc "Setup a GitHub-style deployment."
|
@@ -12,21 +15,47 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
12
15
|
run "git clone #{repository} #{current_path}"
|
13
16
|
end
|
14
17
|
|
18
|
+
task :update do
|
19
|
+
transaction do
|
20
|
+
update_code
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
15
24
|
desc "Update the deployed code."
|
16
25
|
task :update_code, :roles => [:app, :static, :worker], :except => { :no_release => true } do
|
17
|
-
run "cd #{current_path}; git fetch origin; git reset --hard
|
26
|
+
run "cd #{current_path}; git fetch origin; git reset --hard origin/#{branch}; git submodule update --init"
|
27
|
+
if fetch(:finalize_deploy, true)
|
28
|
+
finalize_update
|
29
|
+
end
|
18
30
|
end
|
19
31
|
|
32
|
+
desc "Update the database (overwritten to avoid symlink)"
|
33
|
+
task :migrations do
|
34
|
+
transaction do
|
35
|
+
update_code
|
36
|
+
end
|
37
|
+
migrate
|
38
|
+
end
|
39
|
+
|
40
|
+
|
20
41
|
# "rollback" is actually a namespace with a default task
|
42
|
+
# we overwrite the default task below to get our new behavior
|
21
43
|
namespace :rollback do
|
22
|
-
desc "
|
23
|
-
task :
|
24
|
-
set :branch, "HEAD
|
44
|
+
desc "Moves the repo back to the previous version of HEAD"
|
45
|
+
task :repo, :except => { :no_release => true }, :roles => [:app, :static, :worker] do
|
46
|
+
set :branch, "HEAD@{1}"
|
25
47
|
deploy.default
|
26
48
|
end
|
27
49
|
|
28
|
-
|
29
|
-
|
50
|
+
desc "Rewrite reflog so HEAD@{1} will continue to point to at the next previous release."
|
51
|
+
task :cleanup, :except => { :no_release => true }, :roles => [:app, :static, :worker] do
|
52
|
+
run "cd #{current_path}; git reflog delete --rewrite HEAD@{1}; git reflog delete --rewrite HEAD@{1}"
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "Rolls back to the previously deployed version."
|
56
|
+
task :default do
|
57
|
+
rollback.repo
|
58
|
+
rollback.cleanup
|
30
59
|
end
|
31
60
|
end
|
32
61
|
|
@@ -5,7 +5,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
5
5
|
|
6
6
|
namespace :passenger do
|
7
7
|
desc "Restart Application"
|
8
|
-
task :restart, :roles => [:app] do
|
8
|
+
task :restart, :except => { :no_release => true }, :roles => [:app] do
|
9
9
|
run "touch #{current_path}/tmp/restart.txt"
|
10
10
|
end
|
11
11
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
|
3
|
+
namespace :sass do
|
4
|
+
|
5
|
+
desc "Generate the compiled CSS files from Sass"
|
6
|
+
task :update_stylesheets, :roles => [:static] do
|
7
|
+
run "cd #{current_path}; script/runner -e #{rails_env} 'Sass::Plugin.update_stylesheets'"
|
8
|
+
end
|
9
|
+
|
10
|
+
end # end namespace
|
11
|
+
|
12
|
+
end
|
data/lib/recipes/sass.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
+
|
3
|
+
namespace :varnish do
|
4
|
+
|
5
|
+
desc "Generate the compiled CSS files from Sass"
|
6
|
+
task :clear_cache, :roles => [:proxy] do
|
7
|
+
sudo 'varnishadm -T localhost:6082 purge.url ".*"'
|
8
|
+
end
|
9
|
+
|
10
|
+
end # end namespace
|
11
|
+
|
12
|
+
end
|
data/thunder_punch.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{thunder_punch}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bob Burbach"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-06}
|
13
13
|
s.description = %q{Collection of capistano recipes for deployment and server tasks}
|
14
14
|
s.email = %q{govpulse@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -38,7 +38,11 @@ Gem::Specification.new do |s|
|
|
38
38
|
"lib/recipes/ec2/ami.rb",
|
39
39
|
"lib/recipes/jekyll/jekyll.rb",
|
40
40
|
"lib/recipes/less/less.rb",
|
41
|
+
"lib/recipes/sass.rb",
|
42
|
+
"lib/recipes/sass/compile.rb",
|
41
43
|
"lib/recipes/thinking_sphinx.rb",
|
44
|
+
"lib/recipes/varnish.rb",
|
45
|
+
"lib/recipes/varnish/cache.rb",
|
42
46
|
"lib/thunder_punch.rb",
|
43
47
|
"lib/utilities/utilities.rb",
|
44
48
|
"test/helper.rb",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 6
|
9
|
+
version: 0.0.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bob Burbach
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-06 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -74,7 +74,11 @@ files:
|
|
74
74
|
- lib/recipes/ec2/ami.rb
|
75
75
|
- lib/recipes/jekyll/jekyll.rb
|
76
76
|
- lib/recipes/less/less.rb
|
77
|
+
- lib/recipes/sass.rb
|
78
|
+
- lib/recipes/sass/compile.rb
|
77
79
|
- lib/recipes/thinking_sphinx.rb
|
80
|
+
- lib/recipes/varnish.rb
|
81
|
+
- lib/recipes/varnish/cache.rb
|
78
82
|
- lib/thunder_punch.rb
|
79
83
|
- lib/utilities/utilities.rb
|
80
84
|
- test/helper.rb
|