capistrano-git-copy 0.3.0 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4071457c639166076052d94779f9fb7b78f67df6
4
- data.tar.gz: 91fff803b0beaad67d114d7d9d9ba8def134abbd
3
+ metadata.gz: 94972a5b5759dadb2f2ebf2e41d36803676830f4
4
+ data.tar.gz: f790c70439a4c18692d666148bf243da068bbe0e
5
5
  SHA512:
6
- metadata.gz: 715d74acefef227adf864d744af203628337ba5d229d7b93a0c6a2d99cf01f831d740eea0d0bd24d0172c6e5915ea92bb503e4232846c11974e4793e1d4cd892
7
- data.tar.gz: bf787dbe3850e122baeda5f0eda224d561a6b2fe25e3ff9e95f4ceff2e97c93c5c4af9f67dfa92d691d084a78de0d8740846ef9f8eba23dc6967f94344dc4788
6
+ metadata.gz: e2f15230b238f8fce7ed92857ecaecc88df80f00d93a487905942792556c242d8f53cee21c2210c080472c280bd16e4f1524d5540940705683030774ebb5b9b1
7
+ data.tar.gz: 411ef9a081b6479098a5246a5a433f81b9b1141d3dfce9b547596e21bbf92ddf05aba46e3263d5bed8971b438a294faf121414672ca5704ab3c20d37e8e097dc
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency 'bundler', '~> 1.3'
24
24
  spec.add_development_dependency 'rake'
25
+ spec.add_development_dependency 'yard'
25
26
  end
@@ -1,6 +1,12 @@
1
+ # Capistrano
1
2
  module Capistrano
3
+ # GIT
2
4
  module Git
5
+ # Copy
3
6
  module Copy
7
+ # Quick-Access to this gems root directory
8
+ #
9
+ # @return [String] Root directory of this gem
4
10
  def self.root_path
5
11
  File.expand_path('../../../..', __FILE__)
6
12
  end
@@ -1,3 +1,3 @@
1
1
  require 'tmpdir'
2
2
 
3
- load File.expand_path("../tasks/deploy.cap", __FILE__)
3
+ load File.expand_path('../tasks/deploy.cap', __FILE__)
@@ -10,7 +10,6 @@ namespace :load do
10
10
  end
11
11
 
12
12
  namespace :git_copy do
13
-
14
13
  task :wrapper do
15
14
  on roles :all do
16
15
  fail "git-archive-all binary not found" if fetch(:git_archive_all_bin).strip.length == 0
@@ -22,21 +21,23 @@ namespace :git_copy do
22
21
 
23
22
  desc 'Create tar and upload to server'
24
23
  task update: :'git_copy:wrapper' do
25
- local_repo_path = File.join(fetch(:git_copy_tmp_path), 'repo')
26
- local_tar_file = File.join(fetch(:git_copy_tmp_path), 'archive.tar.gz')
24
+ tmp_path = fetch(:git_copy_tmp_path)
25
+ local_repo_path = File.join(tmp_path, 'repo')
26
+ local_tar_file = File.join(tmp_path, 'archive.tar.gz')
27
+
28
+ local_repo_url = `cd #{local_repo_path} 2>/dev/null && git config --get remote.origin.url 2>/dev/null`.strip
27
29
 
28
- system("rm -rf #{fetch(:git_copy_tmp_path)}")
29
- system("mkdir -p #{fetch(:git_copy_tmp_path)}")
30
+ system("rm -rf #{tmp_path}") unless fetch(:repo_url) == local_repo_url
31
+ system("mkdir -p #{tmp_path}")
30
32
 
31
- system("git clone #{fetch(:repo_url)} #{local_repo_path}")
33
+ system("if [ -d #{local_repo_path} ]; then cd #{local_repo_path} && git fetch origin; else git clone #{fetch(:repo_url)} #{local_repo_path}; fi")
32
34
 
33
35
  on roles :all do
34
- system("cd #{local_repo_path} && git checkout #{fetch(:branch)} && git submodule init && git submodule update && git-archive-all __tmp.tar")
36
+ system("cd #{local_repo_path} && git reset --hard origin/#{fetch(:branch)} && git submodule init && git submodule update && git-archive-all __tmp.tar")
35
37
  system("cd #{local_repo_path} && tar -xf __tmp.tar && cd __tmp && tar -czf #{local_tar_file} .")
36
38
 
37
39
  upload!(local_tar_file, "#{fetch(:tmp_dir)}/#{fetch(:application)}_#{fetch(:stage)}.tar.gz")
38
40
 
39
- system("rm -rf #{local_repo_path}")
40
41
  system("rm -rf #{local_tar_file}")
41
42
  end
42
43
  end
@@ -1,7 +1,8 @@
1
1
  module Capistrano
2
2
  module Git
3
3
  module Copy
4
- VERSION = '0.3.0'
4
+ # gem version
5
+ VERSION = '0.4.0'
5
6
  end
6
7
  end
7
8
  end
metadata CHANGED
@@ -1,55 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-git-copy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Schwab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-08 00:00:00.000000000 Z
11
+ date: 2014-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: yard
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  description: Copy local git repository deploy strategy for capistrano
@@ -59,7 +73,7 @@ executables: []
59
73
  extensions: []
60
74
  extra_rdoc_files: []
61
75
  files:
62
- - .gitignore
76
+ - ".gitignore"
63
77
  - Gemfile
64
78
  - LICENSE.txt
65
79
  - README.md
@@ -82,18 +96,19 @@ require_paths:
82
96
  - lib
83
97
  required_ruby_version: !ruby/object:Gem::Requirement
84
98
  requirements:
85
- - - '>='
99
+ - - ">="
86
100
  - !ruby/object:Gem::Version
87
101
  version: '0'
88
102
  required_rubygems_version: !ruby/object:Gem::Requirement
89
103
  requirements:
90
- - - '>='
104
+ - - ">="
91
105
  - !ruby/object:Gem::Version
92
106
  version: '0'
93
107
  requirements: []
94
108
  rubyforge_project:
95
- rubygems_version: 2.0.3
109
+ rubygems_version: 2.2.0
96
110
  signing_key:
97
111
  specification_version: 4
98
112
  summary: Copy local git repository deploy strategy for capistrano
99
113
  test_files: []
114
+ has_rdoc: