capistrano-scm-localcopy 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 35f70819b9e7ae6278ad87db958f48e6563c071e
4
+ data.tar.gz: cb53cd0d416ab90cf8361b8e23c12e62dacf80db
5
+ SHA512:
6
+ metadata.gz: 7e2c082f5cf9d145e78a6837e617d6ff6699a4aab7f8a2bb8e369e427e119209d17a49eda2d37ef69df3a92ee8f27ab1f276a021ab4df7b15952393296f52531
7
+ data.tar.gz: 25c92578f730e42e582fc7220b018d47a2e33b444002b2a37cf9a398a77610c45fe49bc50ef02ded82f6e3da3c2785afd9ca20c1288d49bf5b30a706ccb58a2d
@@ -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) 2016 Vincent Tavernier
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.
@@ -0,0 +1,55 @@
1
+ capistrano-scm-localcopy
2
+ ===================
3
+
4
+ A copy strategy for Capistrano 3, which mimics the `:copy` scm of Capistrano 2.
5
+
6
+ This will make Capistrano tar the current directory, upload it to the server(s) and then extract it in the release directory.
7
+
8
+ Based on wercker's [capistrano-scm-copy](https://github.com/wercker/capistrano-scm-copy)
9
+
10
+ Requirements
11
+ ============
12
+
13
+ Machine running Capistrano:
14
+
15
+ - Capistrano 3
16
+ - tar
17
+
18
+ Servers:
19
+
20
+ - mktemp
21
+ - tar
22
+
23
+ Installation
24
+ ============
25
+
26
+ First make sure you install the capistrano-scm-copy by adding it to your `Gemfile`:
27
+
28
+ gem "capistrano-scm-localcopy"
29
+
30
+ Add to Capfile:
31
+
32
+ require 'capistrano/localcopy'
33
+
34
+ Then switch the `:scm` option to `:localcopy` in `config/deploy.rb`:
35
+
36
+ set :scm, :localcopy
37
+
38
+ TODO
39
+ ====
40
+
41
+ Add unit tests.
42
+
43
+ License
44
+ =======
45
+
46
+ The MIT License (MIT)
47
+
48
+ Changelog
49
+ =========
50
+
51
+ 0.1.0
52
+ -----
53
+
54
+ - Initial release, based on https://github.com/wercker/capistrano-scm-copy
55
+
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -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-localcopy"
6
+ s.version = "0.1.0"
7
+ s.licenses = ["MIT"]
8
+ s.authors = ["Vincent Tavernier"]
9
+ s.email = ["vince.tavernier@gmail.com"]
10
+ s.homepage = "https://github.com/Vince300/capistrano-scm-localcopy"
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/localcopy.rake', __FILE__)
@@ -0,0 +1,60 @@
1
+ namespace :localcopy do
2
+ def archive_name
3
+ fetch(:archive_name, "archive.tar.gz")
4
+ end
5
+
6
+ def include_dir
7
+ fetch(:include_dir, "*")
8
+ end
9
+
10
+ def exclude_dir
11
+ Array(fetch(:exclude_dir, []))
12
+ end
13
+
14
+ def exclude_args
15
+ exclude_dir.map { |dir| [ "--exclude", dir] }.flatten
16
+ end
17
+
18
+ def tar_roles
19
+ fetch(:tar_roles, :all)
20
+ end
21
+
22
+ def tar_verbose
23
+ fetch(:tar_verbose, true)
24
+ end
25
+
26
+ desc "Archive files to #{archive_name}"
27
+ file archive_name => FileList[include_dir].exclude(archive_name) do |t|
28
+ sh "tar", "-c#{tar_verbose ? "v" : ""}zf", t.name, *exclude_args, *t.prerequisites
29
+ end
30
+
31
+ desc "Deploy #{archive_name} to release_path"
32
+ task :deploy => archive_name do |t|
33
+ tarball = t.prerequisites.first
34
+
35
+ on roles(tar_roles) do
36
+ # Make sure the release directory exists
37
+ puts "==> release_path: #{release_path} is created on #{tar_roles} roles <=="
38
+ execute :mkdir, "-p", release_path
39
+
40
+ # Create a temporary file on the server
41
+ tmp_file = capture("mktemp")
42
+
43
+ # Upload the archive, extract it and finally remove the tmp_file
44
+ upload!(tarball, tmp_file)
45
+ execute :tar, "-xzf", tmp_file, "-C", release_path
46
+ execute :rm, tmp_file
47
+ end
48
+ end
49
+
50
+ task :clean do |t|
51
+ # Delete the local archive
52
+ File.delete archive_name if File.exists? archive_name
53
+ end
54
+
55
+ after 'deploy:finished', 'localcopy:clean'
56
+
57
+ task :create_release => :deploy
58
+ task :check
59
+ task :set_current_revision
60
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-scm-localcopy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Vincent Tavernier
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-06 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
+ - vince.tavernier@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - capistrano-scm-localcopy.gemspec
40
+ - lib/capistrano-scm-localcopy.rb
41
+ - lib/capistrano/localcopy.rb
42
+ - lib/capistrano/tasks/localcopy.rake
43
+ homepage: https://github.com/Vince300/capistrano-scm-localcopy
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.5.1
64
+ signing_key:
65
+ specification_version: 4
66
+ summary: Copy strategy for capistrano 3.x
67
+ test_files: []