youthtree-capistrano 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'capistrano/recipes/deploy/scm/git'
|
2
|
+
|
3
|
+
Capistrano::Deploy::SCM::Git.class_eval do
|
4
|
+
|
5
|
+
# Performs a clone on the remote machine, then checkout on the branch you want to deploy.
|
6
|
+
# This differs from the normal version in that it adds recursive to the --update command.
|
7
|
+
def checkout(revision, destination)
|
8
|
+
git = command
|
9
|
+
remote = origin
|
10
|
+
|
11
|
+
args = []
|
12
|
+
args << "-o #{remote}" unless remote == 'origin'
|
13
|
+
if depth = variable(:git_shallow_clone)
|
14
|
+
args << "--depth #{depth}"
|
15
|
+
end
|
16
|
+
|
17
|
+
execute = []
|
18
|
+
if args.empty?
|
19
|
+
execute << "#{git} clone #{verbose} #{variable(:repository)} #{destination}"
|
20
|
+
else
|
21
|
+
execute << "#{git} clone #{verbose} #{args.join(' ')} #{variable(:repository)} #{destination}"
|
22
|
+
end
|
23
|
+
|
24
|
+
# checkout into a local branch rather than a detached HEAD
|
25
|
+
execute << "cd #{destination} && #{git} checkout #{verbose} -b deploy #{revision}"
|
26
|
+
|
27
|
+
if variable(:git_enable_submodules)
|
28
|
+
execute << "#{git} submodule #{verbose} init"
|
29
|
+
execute << "#{git} submodule #{verbose} sync"
|
30
|
+
execute << "#{git} submodule #{verbose} update --recursive"
|
31
|
+
end
|
32
|
+
|
33
|
+
execute.join(" && ")
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module YouthTree
|
2
2
|
module Capistrano
|
3
|
-
VERSION = "0.
|
3
|
+
VERSION = "0.3.0".freeze
|
4
4
|
|
5
5
|
def self.load(&blk)
|
6
6
|
::Capistrano::Configuration.instance(:must_exist).load(&blk)
|
@@ -15,6 +15,7 @@ module YouthTree
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.load_all!
|
18
|
+
require 'youth_tree/capistrano/git_submodule_fix'
|
18
19
|
load_recipe! %w(base rvm git bundler settings db unicorn compass barista jammit uploads syncing)
|
19
20
|
load { load 'deploy' }
|
20
21
|
load_recipe! 'deploy_hooks'
|
@@ -1,19 +1,19 @@
|
|
1
1
|
YouthTree::Capistrano.load do
|
2
2
|
|
3
3
|
namespace :deploy do
|
4
|
-
desc "Call
|
4
|
+
desc "Call start on your server"
|
5
5
|
task :start, :roles => :app do
|
6
|
-
|
6
|
+
send(server_name.to_sym).start
|
7
7
|
end
|
8
8
|
|
9
|
-
desc "Call
|
9
|
+
desc "Call stop on your server"
|
10
10
|
task :stop, :roles => :app do
|
11
|
-
|
11
|
+
send(server_name.to_sym).stop
|
12
12
|
end
|
13
13
|
|
14
|
-
desc "Call
|
14
|
+
desc "Call restart on your server"
|
15
15
|
task :restart, :roles => :app, :except => { :no_release => true } do
|
16
|
-
|
16
|
+
send(server_name.to_sym).restart
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
YouthTree::Capistrano.load_named(:passenger) do
|
2
|
+
|
3
|
+
yt_cset :passenger_restart_file, 'tmp/restart.txt'
|
4
|
+
yt_cset :server_name, 'passenger'
|
5
|
+
|
6
|
+
namespace :passenger do
|
7
|
+
|
8
|
+
desc "Starts the passenger app server"
|
9
|
+
task :start, :roles => :app do
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "Stops the passenger app server"
|
13
|
+
task :stop, :roles => :app do
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "Restarts passenger"
|
17
|
+
task :restart, :roles => :app do
|
18
|
+
file = File.join(current_path, passenger_restart_file)
|
19
|
+
run "mkdir -p '#{File.dirname(file)}' && touch '#{file}'"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{youthtree-capistrano}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Darcy Laycock"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-03}
|
13
13
|
s.description = %q{Capistrano tasks used for common Youth Tree deployments.}
|
14
14
|
s.email = %q{sutto@sutto.net}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -17,26 +17,27 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
s.files = [
|
19
19
|
"README.md",
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
20
|
+
"Rakefile",
|
21
|
+
"lib/youth_tree/capistrano.rb",
|
22
|
+
"lib/youth_tree/capistrano/git_submodule_fix.rb",
|
23
|
+
"lib/youth_tree/recipes/barista.rb",
|
24
|
+
"lib/youth_tree/recipes/base.rb",
|
25
|
+
"lib/youth_tree/recipes/bundler.rb",
|
26
|
+
"lib/youth_tree/recipes/compass.rb",
|
27
|
+
"lib/youth_tree/recipes/db.rb",
|
28
|
+
"lib/youth_tree/recipes/deploy_hooks.rb",
|
29
|
+
"lib/youth_tree/recipes/git.rb",
|
30
|
+
"lib/youth_tree/recipes/jammit.rb",
|
31
|
+
"lib/youth_tree/recipes/passenger.rb",
|
32
|
+
"lib/youth_tree/recipes/rvm.rb",
|
33
|
+
"lib/youth_tree/recipes/settings.rb",
|
34
|
+
"lib/youth_tree/recipes/syncing.rb",
|
35
|
+
"lib/youth_tree/recipes/unicorn.rb",
|
36
|
+
"lib/youth_tree/recipes/uploads.rb",
|
37
|
+
"lib/youthtree-capistrano.rb",
|
38
|
+
"youthtree-capistrano.gemspec"
|
37
39
|
]
|
38
40
|
s.homepage = %q{http://github.com/YouthTree/youthtree-capistrano}
|
39
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
40
41
|
s.require_paths = ["lib"]
|
41
42
|
s.rubygems_version = %q{1.3.7}
|
42
43
|
s.summary = %q{Capistrano tasks used for common Youth Tree deployments.}
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Darcy Laycock
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-03 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- README.md
|
89
89
|
- Rakefile
|
90
90
|
- lib/youth_tree/capistrano.rb
|
91
|
+
- lib/youth_tree/capistrano/git_submodule_fix.rb
|
91
92
|
- lib/youth_tree/recipes/barista.rb
|
92
93
|
- lib/youth_tree/recipes/base.rb
|
93
94
|
- lib/youth_tree/recipes/bundler.rb
|
@@ -96,6 +97,7 @@ files:
|
|
96
97
|
- lib/youth_tree/recipes/deploy_hooks.rb
|
97
98
|
- lib/youth_tree/recipes/git.rb
|
98
99
|
- lib/youth_tree/recipes/jammit.rb
|
100
|
+
- lib/youth_tree/recipes/passenger.rb
|
99
101
|
- lib/youth_tree/recipes/rvm.rb
|
100
102
|
- lib/youth_tree/recipes/settings.rb
|
101
103
|
- lib/youth_tree/recipes/syncing.rb
|
@@ -108,8 +110,8 @@ homepage: http://github.com/YouthTree/youthtree-capistrano
|
|
108
110
|
licenses: []
|
109
111
|
|
110
112
|
post_install_message:
|
111
|
-
rdoc_options:
|
112
|
-
|
113
|
+
rdoc_options: []
|
114
|
+
|
113
115
|
require_paths:
|
114
116
|
- lib
|
115
117
|
required_ruby_version: !ruby/object:Gem::Requirement
|