capistrano-deploy 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -3,4 +3,5 @@ pkg/*
3
3
  .bundle
4
4
  .yardoc
5
5
  doc
6
+ Gemfile.lock
6
7
  vendor/bundle
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Capistrano deploy recipes [![TravisCI](https://secure.travis-ci.org/lest/capistrano-deploy.png?branch=master)](http://travis-ci.org/lest/capistrano-deploy)
1
+ Capistrano deploy recipes [![TravisCI](https://secure.travis-ci.org/lest/capistrano-deploy.png?branch=master)](http://travis-ci.org/lest/capistrano-deploy) [![Gemnasium](https://gemnasium.com/lest/capistrano-deploy.png)](https://gemnasium.com/lest/capistrano-deploy)
2
2
  =========================
3
3
 
4
4
  Inspired by https://github.com/blog/470-deployment-script-spring-cleaning.
@@ -6,18 +6,30 @@ Inspired by https://github.com/blog/470-deployment-script-spring-cleaning.
6
6
  Quickstart with Git and Rails
7
7
  -----------------------------
8
8
 
9
- Minimal Capfile for Rails deploy using Git:
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano-deploy', :group => :development, :require => false
13
+ ```
14
+
15
+ Create a file named `Capfile` in your project root directory:
10
16
 
11
17
  ```ruby
12
18
  require 'capistrano-deploy'
13
- use_recipes :git, :rails
19
+ use_recipes :git, :bundle, :rails
14
20
 
15
21
  server 'server name or ip address', :web, :app, :db, :primary => true
16
22
  set :user, 'user for deploy'
17
23
  set :deploy_to, '/deploy/to/path'
18
24
  set :repository, 'your git repository'
25
+
26
+ after 'deploy:update', 'bundle:install'
19
27
  ```
20
28
 
29
+ And then execute:
30
+
31
+ bundle
32
+
21
33
  To setup:
22
34
 
23
35
  cap deploy:setup
@@ -34,6 +46,12 @@ To look through the changes to be deployed:
34
46
 
35
47
  cap deploy:pending
36
48
 
49
+ If you want to update to a specific commit (e.g. to rollback):
50
+
51
+ cap deploy COMMIT=foobarbaz
52
+
53
+ Note: it may be required to run `bundle exec cap ...` instead of `cap ...`.
54
+
37
55
  Multistage
38
56
  ----------
39
57
 
@@ -84,7 +102,7 @@ Rails Assets
84
102
  Use recipe:
85
103
 
86
104
  ```ruby
87
- use_recipe :bundle
105
+ use_recipe :rails_assets
88
106
  ```
89
107
 
90
108
  Add callback to precompile assets after update:
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'capistrano-deploy'
4
- s.version = '0.3.1'
4
+ s.version = '0.3.2'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Sergey Nartimov']
7
7
  s.email = ['just.lest@gmail.com']
@@ -12,5 +12,5 @@ Gem::Specification.new do |s|
12
12
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
13
13
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
14
14
 
15
- s.add_dependency('capistrano', '~> 2.9.0')
15
+ s.add_dependency('capistrano', '~> 2.9')
16
16
  end
@@ -24,14 +24,16 @@ module CapistranoDeploy
24
24
 
25
25
  desc 'Update the deployed code'
26
26
  task :update, :except => {:no_release => true} do
27
- command = ["cd #{deploy_to}", 'git fetch origin', "git reset --hard origin/#{branch}"]
27
+ commit = ENV['COMMIT'] || "origin/#{branch}"
28
+ command = ["cd #{deploy_to}", 'git fetch origin', "git reset --hard #{commit}"]
28
29
  command += ['git submodule init', 'git submodule -q sync', 'git submodule -q update'] if enable_submodules
29
30
  run command.join(' && ')
30
31
  end
31
32
 
32
33
  desc 'Show pending commits'
33
34
  task :pending do
34
- system("git log --pretty=medium --stat #{current_revision}..origin/#{branch}")
35
+ commit = ENV['COMMIT'] || "origin/#{branch}"
36
+ system("git log --pretty=medium --stat #{current_revision}..#{commit}")
35
37
  end
36
38
  end
37
39
  end
@@ -6,6 +6,8 @@ describe 'git' do
6
6
  use_recipe :git
7
7
  set :deploy_to, '/foo/bar'
8
8
  end
9
+
10
+ ENV.delete('COMMIT')
9
11
  end
10
12
 
11
13
  it 'has branch' do
@@ -44,6 +46,11 @@ describe 'git' do
44
46
  cli_execute 'deploy:update'
45
47
  config.should have_run('cd /foo/bar && git fetch origin && git reset --hard origin/master && git submodule init && git submodule -q sync && git submodule -q update')
46
48
  end
49
+
50
+ it 'updates to specific commit' do
51
+ cli_execute 'deploy:update', 'COMMIT=foobarbaz'
52
+ config.should have_run('cd /foo/bar && git fetch origin && git reset --hard foobarbaz')
53
+ end
47
54
  end
48
55
  end
49
56
 
@@ -58,6 +65,12 @@ describe 'git' do
58
65
  cli_execute 'deploy:pending'
59
66
  end
60
67
 
68
+ it 'shows pending against specific commit' do
69
+ config.should_receive(:current_revision) { 'baz' }
70
+ config.namespaces[:deploy].should_receive(:system).with('git log --pretty=medium --stat baz..foobarbaz')
71
+ cli_execute 'deploy:pending', 'COMMIT=foobarbaz'
72
+ end
73
+
61
74
  it 'sets forward agent' do
62
75
  config.ssh_options[:forward_agent].should == true
63
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-18 00:00:00.000000000 Z
12
+ date: 2012-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &2152294620 !ruby/object:Gem::Requirement
16
+ requirement: &2152701100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.9.0
21
+ version: '2.9'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152294620
24
+ version_requirements: *2152701100
25
25
  description:
26
26
  email:
27
27
  - just.lest@gmail.com
@@ -33,7 +33,6 @@ files:
33
33
  - .rspec
34
34
  - .travis.yml
35
35
  - Gemfile
36
- - Gemfile.lock
37
36
  - MIT-LICENSE
38
37
  - README.md
39
38
  - Rakefile
@@ -73,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
72
  version: '0'
74
73
  segments:
75
74
  - 0
76
- hash: -2795208972742122785
75
+ hash: 3055610007075838106
77
76
  required_rubygems_version: !ruby/object:Gem::Requirement
78
77
  none: false
79
78
  requirements:
@@ -82,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
81
  version: '0'
83
82
  segments:
84
83
  - 0
85
- hash: -2795208972742122785
84
+ hash: 3055610007075838106
86
85
  requirements: []
87
86
  rubyforge_project:
88
87
  rubygems_version: 1.8.11
@@ -1,41 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- capistrano-deploy (0.3.1)
5
- capistrano (~> 2.9.0)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- capistrano (2.9.0)
11
- highline
12
- net-scp (>= 1.0.0)
13
- net-sftp (>= 2.0.0)
14
- net-ssh (>= 2.0.14)
15
- net-ssh-gateway (>= 1.1.0)
16
- diff-lcs (1.1.3)
17
- highline (1.6.9)
18
- net-scp (1.0.4)
19
- net-ssh (>= 1.99.1)
20
- net-sftp (2.0.5)
21
- net-ssh (>= 2.0.9)
22
- net-ssh (2.2.2)
23
- net-ssh-gateway (1.1.0)
24
- net-ssh (>= 1.99.1)
25
- rake (0.9.2.2)
26
- rspec (2.8.0)
27
- rspec-core (~> 2.8.0)
28
- rspec-expectations (~> 2.8.0)
29
- rspec-mocks (~> 2.8.0)
30
- rspec-core (2.8.0)
31
- rspec-expectations (2.8.0)
32
- diff-lcs (~> 1.1.2)
33
- rspec-mocks (2.8.0)
34
-
35
- PLATFORMS
36
- ruby
37
-
38
- DEPENDENCIES
39
- capistrano-deploy!
40
- rake
41
- rspec