capistrano-git-copy 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/git/copy/tasks/deploy.cap +15 -8
- data/lib/capistrano/git/copy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebf8972754ecc7f4d30e9226bc5ce379c0e140b5
|
4
|
+
data.tar.gz: 89e3eb756e62ffe59be1e5376caa79995021e631
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c08617c6f6d583355e3371f73efa84c385e924723e77e8b1e50ea5d7913a8b3b7ffdfd0b25ef01aee5380bbffd7456988c9c12e317b04c874e54e10f14797738
|
7
|
+
data.tar.gz: 95adbebfb60bf7e59625406026c01d76146d397d4a27aa9e5a238a0a455a24ad7850d30cf3458261c8f2021a124b0ed933749eb64864002b7b8c441e78bbc118
|
@@ -1,8 +1,8 @@
|
|
1
1
|
namespace :load do
|
2
2
|
task :defaults do
|
3
3
|
set :git_archive_all_bin, -> {
|
4
|
-
bin = `which git-archive-all
|
5
|
-
bin.
|
4
|
+
bin = `which git-archive-all`.strip
|
5
|
+
bin.length > 0 ? bin : File.join(Capistrano::Git::Copy.root_path, 'vendor', 'bin', 'git-archive-all')
|
6
6
|
}
|
7
7
|
|
8
8
|
set :git_copy_tmp_path, -> { File.join(Dir.tmpdir, "#{fetch(:application)}_#{fetch(:stage)}") }
|
@@ -11,9 +11,7 @@ end
|
|
11
11
|
|
12
12
|
namespace :git_copy do
|
13
13
|
task :wrapper do
|
14
|
-
|
15
|
-
fail "git-archive-all binary not found" if fetch(:git_archive_all_bin).strip.length == 0
|
16
|
-
end
|
14
|
+
fail "git-archive-all binary not found" if fetch(:git_archive_all_bin).strip.length == 0
|
17
15
|
end
|
18
16
|
|
19
17
|
task :check do; end
|
@@ -32,10 +30,10 @@ namespace :git_copy do
|
|
32
30
|
|
33
31
|
system("if [ -d #{local_repo_path} ]; then cd #{local_repo_path} && git fetch origin; else git clone #{fetch(:repo_url)} #{local_repo_path}; fi")
|
34
32
|
|
35
|
-
system("cd #{local_repo_path} && git reset --hard origin/#{fetch(:branch)} && git submodule init && git submodule update &&
|
33
|
+
system("cd #{local_repo_path} && git reset --hard origin/#{fetch(:branch, 'master')} && git submodule init && git submodule update && #{fetch(:git_archive_all_bin)} __tmp.tar")
|
36
34
|
system("cd #{local_repo_path} && tar -xf __tmp.tar && cd __tmp && tar -czf #{local_tar_file} .")
|
37
35
|
|
38
|
-
on
|
36
|
+
on release_roles :all do
|
39
37
|
upload!(local_tar_file, "#{fetch(:tmp_dir)}/#{fetch(:application)}_#{fetch(:stage)}.tar.gz")
|
40
38
|
end
|
41
39
|
|
@@ -44,10 +42,19 @@ namespace :git_copy do
|
|
44
42
|
|
45
43
|
desc 'Extract tar to release path'
|
46
44
|
task create_release: :'git_copy:update' do
|
47
|
-
on
|
45
|
+
on release_roles :all do
|
48
46
|
execute(:mkdir, '-p', release_path)
|
49
47
|
execute(:tar, '-f', "#{fetch(:tmp_dir)}/#{fetch(:application)}_#{fetch(:stage)}.tar.gz", '-x -C', release_path)
|
50
48
|
execute(:rm, '-f', "#{fetch(:tmp_dir)}/#{fetch(:application)}_#{fetch(:stage)}.tar.gz")
|
51
49
|
end
|
52
50
|
end
|
51
|
+
|
52
|
+
desc 'Determine the revision that will be deployed'
|
53
|
+
task set_current_revision: :'git_copy:wrapper' do
|
54
|
+
revision = `git rev-parse --short #{fetch(:branch, 'master')} 2>/dev/null`.strip
|
55
|
+
|
56
|
+
on release_roles :all do
|
57
|
+
set :current_revision, revision
|
58
|
+
end
|
59
|
+
end
|
53
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-git-copy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.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-04-
|
11
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|