capistrano-remote-cache-with-project-root 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-remote-cache-with-project-root.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Matteo Collina
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Capistrano Remote Cache With Project Root Deployment Strategy
2
+
3
+ This library extends the RemoteCache strategy in order to
4
+ support deployment from internal folders, e.g. yours
5
+ `Rails.root` resides inside `/yourapp`.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'capistrano-remote-cache-with-project-root'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install capistrano-remote-cache-with-project-root
20
+
21
+ ## Usage
22
+
23
+ Add these lines to your Capistrano recipe:
24
+
25
+ set :deploy_via, "remote_cache_with_project_root"
26
+ set :project_root, "relative/path/to/your/project"
27
+
28
+ ## Contributing
29
+
30
+ 1. Fork it
31
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
32
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
33
+ 4. Push to the branch (`git push origin my-new-feature`)
34
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/capistrano/recipes/deploy/strategy/remote_cache_with_project_root', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Matteo Collina"]
6
+ gem.email = ["matteo.collina@gmail.com"]
7
+ gem.description = %q{Capistrano Strategy for deployment of a project in a subdirectory}
8
+ gem.summary = %q{Capistrano Strategy for deployment of a project in a subdirectory}
9
+ gem.homepage = ""
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ gem.name = "capistrano-remote-cache-with-project-root"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Capistrano::Deploy::Strategy::RemoteCacheWithProjectRoot::VERSION
17
+
18
+
19
+ if gem.respond_to? :specification_version then
20
+ gem.specification_version = 3
21
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
22
+ gem.add_runtime_dependency(%q<capistrano>, [">= 2.7"])
23
+ else
24
+ gem.add_dependency(%q<capistrano>, [">= 2.7"])
25
+ end
26
+ else
27
+ gem.add_dependency(%q<capistrano>, [">= 2.7"])
28
+ end
29
+ end
@@ -0,0 +1,37 @@
1
+ require 'capistrano/recipes/deploy/strategy/remote_cache'
2
+
3
+ module Capistrano
4
+ module Deploy
5
+ module Strategy
6
+
7
+ # Implements the deployment strategy that keeps a cached checkout of
8
+ # the source code on each remote server. Each deploy simply updates the
9
+ # cached checkout, and then does a copy from the cached copy to the
10
+ # final deployment location.
11
+ #
12
+ # it needs a "set :project_root, 'path_to_the_app'" call in your
13
+ # deploy.rb
14
+ class RemoteCacheWithProjectRoot < RemoteCache
15
+
16
+ VERSION = "0.0.1"
17
+
18
+ def copy_repository_cache
19
+
20
+ cached_project_root = File.join(repository_cache, project_root)
21
+
22
+ logger.trace "copying the cached version from #{cached_project_root} to #{configuration[:release_path]}"
23
+
24
+ run "mkdir -p #{configuration[:release_path]}"
25
+
26
+ if copy_exclude.empty?
27
+ run "cp -RPp #{cached_project_root}/* #{configuration[:release_path]} && #{mark}"
28
+ else
29
+ exclusions = copy_exclude.map { |e| "--exclude=\"#{e}\"" }.join(' ')
30
+ run "rsync -lrpt #{exclusions} #{cached_project_root}/* #{configuration[:release_path]} && #{mark}"
31
+ end
32
+ end
33
+ end
34
+
35
+ end
36
+ end
37
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-remote-cache-with-project-root
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Matteo Collina
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-23 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: &22134240 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '2.7'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *22134240
25
+ description: Capistrano Strategy for deployment of a project in a subdirectory
26
+ email:
27
+ - matteo.collina@gmail.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - LICENSE
35
+ - README.md
36
+ - Rakefile
37
+ - capistrano-remote-cache-with-project-root.gemspec
38
+ - lib/capistrano/recipes/deploy/strategy/remote_cache_with_project_root.rb
39
+ homepage: ''
40
+ licenses: []
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 1.8.10
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: Capistrano Strategy for deployment of a project in a subdirectory
63
+ test_files: []