capistrano-tar-files 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e4e07c40e87a0fddaccf06c7de4694e257cb4d0b
4
+ data.tar.gz: 3042d7c269276731f75a48b1b05c701391bad452
5
+ SHA512:
6
+ metadata.gz: 3d46f1eb5c8c371d64baf53e9787b2b79185219d675a22f1ac3019303c232afd8cc18b5fa7b4dcf3ac36eb2bf85db7b81d507765bb19647bafb93c938b173415
7
+ data.tar.gz: 7297d6bac8efec85f5fbc5f909c79e97e41d868e2ac8dc3d736591d0f53668485fe5c4920985c9e99ccf5a280884c460c44dabba2cbe0614cd5eccc59ba64b7e
@@ -0,0 +1 @@
1
+ /.idea/
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) 2017 Andy Palmer
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,41 @@
1
+ capistrano-tar-files
2
+ =====================
3
+
4
+ Capistrano v3.* extension to speed up deployments by creating and unpacking tarball archives
5
+ for directories which don't change much between releases e.g `vendor` and `node_modules`
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano', '~> 3.3.0'
13
+ gem 'capistrano-tar-files'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install capistrano-copy-files
23
+
24
+ ## Usage
25
+
26
+ Require in `Capfile` to use the default task:
27
+
28
+ ```ruby
29
+ require 'capistrano/tar_files'
30
+ ```
31
+
32
+ The task will run during `deploy:updating` as part of Capistrano's default deploy
33
+
34
+ Configurable options:
35
+
36
+ ```ruby
37
+ set :tar_files, [] # default
38
+ set :tar_location, "tarballs" # default
39
+ set :tar_unpack_flags, "xf" # default
40
+ set :tar_create_flags, "cf" # default
41
+ ```
File without changes
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'capistrano-tar-files'
7
+ spec.version = '0.0.1'
8
+ spec.authors = ['Andy Palmer']
9
+ spec.email = ['andy@andypalmer.me']
10
+ spec.description = %q{Create/unpack tarball archives for directories that don't change often like vendor and node_modules}
11
+ spec.summary = %q{Create/unpack tarball archives for directories that don't change often like vendor and node_modules}
12
+ spec.homepage = 'https://github.com/andyexeter/capistrano-tar-files'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'capistrano', '>= 3.0.0'
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'rake'
24
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/tar_files.rake', __FILE__)
File without changes
@@ -0,0 +1,47 @@
1
+ # Task to create and unpack tarball archives during deployment.
2
+ # Useful node_modules, vendor directories etc that don't usually change per deployment.
3
+
4
+ namespace :deploy do
5
+ task :unpack_archives do
6
+ next unless any? :tar_files
7
+ on roles :app do
8
+ fetch(:tar_files).each do |path|
9
+ archive_file = "#{deploy_to}/#{fetch(:tar_location)}/#{path.gsub("/", "_")}.tar"
10
+ unpack_dir = "#{release_path.to_s}/#{path}"
11
+
12
+ if test "[ -f #{archive_file} ]"
13
+ execute :mkdir, "-p", unpack_dir
14
+ execute :tar, fetch(:tar_unpack_flags), archive_file, "-C " + unpack_dir
15
+ else
16
+ warn "#{archive_file} does not exist. Skipping unpacking."
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+ task :create_archives do
23
+ next unless any? :tar_files
24
+ on roles :app do
25
+ execute :mkdir, "-p", "#{deploy_to}/#{fetch(:tar_location)}"
26
+ fetch(:tar_files).each do |path|
27
+ execute :tar, fetch(:tar_create_flags), "#{deploy_to}/#{fetch(:tar_location)}/#{path.gsub("/", "_")}.tar", "-C #{current_path.to_s}/#{path} ."
28
+ end
29
+ end
30
+ end
31
+
32
+ task :updating do
33
+ invoke "deploy:unpack_archives"
34
+ end
35
+ task :finishing do
36
+ invoke "deploy:create_archives"
37
+ end
38
+ end
39
+
40
+ namespace :load do
41
+ task :defaults do
42
+ set :tar_files, []
43
+ set :tar_location, "tarballs"
44
+ set :tar_unpack_flags, "xf"
45
+ set :tar_create_flags, "cf"
46
+ end
47
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-tar-files
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andy Palmer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-05-20 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.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.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Create/unpack tarball archives for directories that don't change often
56
+ like vendor and node_modules
57
+ email:
58
+ - andy@andypalmer.me
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - capistrano-tar-files.gemspec
69
+ - lib/capistrano-tar-files.rb
70
+ - lib/capistrano/tar_files.rb
71
+ - lib/capistrano/tasks/tar_files.rake
72
+ homepage: https://github.com/andyexeter/capistrano-tar-files
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.6.10
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Create/unpack tarball archives for directories that don't change often like
96
+ vendor and node_modules
97
+ test_files: []