capistrano-scm-tar-copy 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c881d002720564cdd6d066c5c3ab7b740398181e
4
+ data.tar.gz: de92be2e0156bb03dd09666b18c121f94a9ca8f3
5
+ SHA512:
6
+ metadata.gz: ab03790cd41042491795a27ac060a697956fad861e927c1eb799cd5b60420bf177a29a054d74174c214b7c94d67d04050b1fa978178a67f4e14d7e699075b139
7
+ data.tar.gz: de2027bf4f98f3d50cd8e5a4bcfa4578c04c3ffe7fe51df3b19c675715222e8af6c9138dd87451b4f8e7b8499a8fb0a5942eb2a00da7f491e602e648e9a4e1dc
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
19
+
20
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 wercker
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,6 @@
1
+
2
+ A copy strategy for Capistrano 3
3
+
4
+ 0.0.1
5
+ -----
6
+ - Initial
data/Rakefile ADDED
File without changes
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "capistrano-scm-tar-copy"
6
+ s.version = "0.0.1"
7
+ s.licenses = ["MIT"]
8
+ s.authors = ["w1ldzer0"]
9
+ s.email = ["mail@w1ldze0.ru"]
10
+ s.homepage = "https://github.com/w1ldzer0/capistrano-scm-tar-copy"
11
+ s.summary = %q{Copy strategy for capistrano 3.x}
12
+ s.description = %q{Copy strategy for capistrano 3.x}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ # specify any dependencies here; for example:
20
+ s.add_dependency "capistrano", "~> 3.0"
21
+ end
File without changes
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/copy.rake', __FILE__)
@@ -0,0 +1,59 @@
1
+ namespace :copy do
2
+
3
+ archive_name = "archive.tar.gz"
4
+
5
+ desc "Archive files to #{archive_name}"
6
+ task :create_archive do |t|
7
+ include_dir = fetch(:include_dir) || "*"
8
+ temp_dir = fetch(:temp_dir) || "/tmp"
9
+ exclude_dir = Array(fetch(:exclude_dir))
10
+
11
+ exclude_args = exclude_dir.map { |dir| "--exclude '#{dir}'"}
12
+
13
+ # Defalut to :all roles
14
+ tar_roles = fetch(:tar_roles, :all)
15
+
16
+ tar_verbose = fetch(:tar_verbose, true) ? "v" : ""
17
+
18
+ file archive_name => FileList[include_dir].exclude(archive_name) do |t|
19
+ cmd = ["cd #{include_dir} && ", "tar -c#{tar_verbose}zf #{temp_dir}/#{t.name}", *exclude_args, '*']
20
+ sh cmd.join(' ')
21
+ end
22
+ end
23
+
24
+ desc "Deploy #{archive_name} to release_path"
25
+ task :deploy => archive_name do |t|
26
+ temp_dir = fetch(:temp_dir) || "/tmp"
27
+ tarball = temp_dir + "/" +t.prerequisites.first
28
+
29
+ # Defalut to :all roles
30
+ tar_roles = fetch(:tar_roles, :all)
31
+
32
+ on roles(tar_roles) do
33
+ # Make sure the release directory exists
34
+ puts "==> release_path: #{release_path} is created on #{tar_roles} roles <=="
35
+ execute :mkdir, "-p", release_path
36
+
37
+ # Create a temporary file on the server
38
+ tmp_file = capture("mktemp")
39
+
40
+ # Upload the archive, extract it and finally remove the tmp_file
41
+ upload!(tarball, tmp_file)
42
+ execute :tar, "-xzf", tmp_file, "-C", release_path
43
+ execute :rm, tmp_file
44
+ end
45
+ end
46
+
47
+ task :clean do |t|
48
+ # Delete the local archive
49
+ File.delete archive_name if File.exists? archive_name
50
+ end
51
+
52
+ after 'deploy:finished', 'copy:clean'
53
+
54
+ task :create_release => :create_archive
55
+ task :create_release => :deploy
56
+ task :check
57
+ task :set_current_revision
58
+
59
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-scm-tar-copy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - w1ldzer0
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ description: Copy strategy for capistrano 3.x
28
+ email:
29
+ - mail@w1ldze0.ru
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - .gitignore
35
+ - Gemfile
36
+ - LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - capistrano-scm-tar-copy.gemspec
40
+ - lib/capistrano-scm-tar-copy.rb
41
+ - lib/capistrano/copy.rb
42
+ - lib/capistrano/tasks/copy.rake
43
+ homepage: https://github.com/w1ldzer0/capistrano-scm-tar-copy
44
+ licenses:
45
+ - MIT
46
+ metadata: {}
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 2.0.14.1
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: Copy strategy for capistrano 3.x
67
+ test_files: []