capistrano_copy 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/capistrano_copy.gemspec +1 -1
- data/lib/capistrano/tasks/copy.rake +41 -38
- 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: 8921dfcf7113d03239217ab980c19d457fc4f3a4
|
4
|
+
data.tar.gz: 82e3736f80e132a2b28b5bc167b5dd364cfc9b6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bccbc04e841be354b6cd338445ece586d1dca6cf7dfff7f827f98e21d17961a1e0cd046a58be08bce5d7bbd0aed877b4dbd9b2ff80abbc8f79409cc1da100a37
|
7
|
+
data.tar.gz: ada5cc88cf05298e2d37f6da096c24fc52e3735ece22e190e3123e0a8db70693db015f90ff4236589269d8eef8ed14c70eac874fdadb0b84b051bda04e77703d
|
data/capistrano_copy.gemspec
CHANGED
@@ -3,56 +3,59 @@ namespace :copy do
|
|
3
3
|
archive_name = "archive.tar.gz"
|
4
4
|
include_dir = fetch(:include_dir) || "*"
|
5
5
|
exclude_dir = Array(fetch(:exclude_dir))
|
6
|
-
base_dir = fetch(:base_dir)
|
7
|
-
@deployed = false
|
6
|
+
base_dir = fetch(:base_dir)
|
8
7
|
|
9
|
-
|
8
|
+
unless base_dir.nil?
|
9
|
+
@deployed = false
|
10
10
|
|
11
|
-
|
12
|
-
tar_roles = fetch(:tar_roles, 'all')
|
11
|
+
exclude_args = exclude_dir.map { |dir| "--exclude '#{dir}'"}
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
# Defalut to :all roles
|
14
|
+
tar_roles = fetch(:tar_roles, 'all')
|
15
|
+
|
16
|
+
desc "Archive files to #{archive_name}"
|
17
|
+
file archive_name => FileList[File.join(base_dir)].exclude(archive_name) do |t|
|
18
|
+
cmd = ["tar -cvz -f #{t.name} #{base_dir}"]
|
19
|
+
sh cmd.join(' ')
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Deploy #{archive_name} to release_path"
|
23
|
+
task :deploy => archive_name do |t|
|
24
|
+
unless @deployed
|
25
|
+
@deployed = true
|
26
|
+
tarball = t.prerequisites.first
|
19
27
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@deployed = true
|
24
|
-
tarball = t.prerequisites.first
|
28
|
+
on roles(:all) do
|
29
|
+
# Make sure the release directory exists
|
30
|
+
execute :mkdir, "-p", release_path
|
25
31
|
|
26
|
-
|
27
|
-
|
28
|
-
execute :mkdir, "-p", release_path
|
32
|
+
# Create a temporary file on the server
|
33
|
+
tmp_file = capture("mktemp")
|
29
34
|
|
30
|
-
|
31
|
-
|
35
|
+
# Upload the archive, extract it and finally remove the tmp_file
|
36
|
+
upload!(tarball, tmp_file)
|
37
|
+
execute :tar, "-xzf", tmp_file, "-C", release_path
|
38
|
+
execute :rm, tmp_file
|
32
39
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
execute :rm, tmp_file
|
40
|
+
# move dist folder to root
|
41
|
+
execute :mv, release_path.join("#{base_dir}/*"), release_path
|
42
|
+
execute :rm, '-rf', release_path.join(base_dir)
|
37
43
|
|
38
|
-
|
39
|
-
|
40
|
-
|
44
|
+
Rake::Task["deploy:symlink:release"].invoke
|
45
|
+
Rake::Task['deploy:finishing'].invoke
|
46
|
+
end
|
41
47
|
|
42
|
-
Rake::Task["
|
43
|
-
Rake::Task['deploy:finishing'].invoke
|
48
|
+
Rake::Task["copy:clean"].invoke
|
44
49
|
end
|
50
|
+
end
|
45
51
|
|
46
|
-
|
52
|
+
task :clean do |t|
|
53
|
+
# Delete the local archive
|
54
|
+
File.delete archive_name if File.exists? archive_name
|
47
55
|
end
|
48
|
-
end
|
49
56
|
|
50
|
-
|
51
|
-
|
52
|
-
|
57
|
+
task :create_release => :deploy
|
58
|
+
task :check
|
59
|
+
task :set_current_revision
|
53
60
|
end
|
54
|
-
|
55
|
-
task :create_release => :deploy
|
56
|
-
task :check
|
57
|
-
task :set_current_revision
|
58
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano_copy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NDrive Dev Ops
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|