remote-cache-with-sudo 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,19 @@
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
18
+ .buildpath
19
+ .project
@@ -0,0 +1,2 @@
1
+ eclipse.preferences.version=1
2
+ encoding/<project>=UTF-8
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in remote-cache-with-sudo.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Capistrano Remote Cache With sudo Deployment Strategy
2
+
3
+ This library extends the RemoteCache strategy in order to
4
+ support deployment using sudo, e.g. when you deploy in a
5
+ system where you have no root access and in locations outside
6
+ the user's home directory, such as /var/www
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'remote-cache-with-sudo'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install remote-cache-with-sudo
21
+
22
+ ## Usage
23
+
24
+ Add these lines to your Capistrano recipe:
25
+
26
+ set :deploy_via, "remote_cache_with_sudo"
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ require 'capistrano/recipes/deploy/strategy/remote_cache'
2
+
3
+ module Capistrano
4
+ module Deploy
5
+ module Strategy
6
+ class RemoteCacheWithSudo < RemoteCache
7
+
8
+ VERSION = "0.0.2"
9
+
10
+ def update_repository_cache
11
+ logger.trace "updating the cached checkout on all servers"
12
+ if use_sudo
13
+ sudo = "sudo"
14
+ end
15
+ command = "if [ -d #{repository_cache} ]; then " +
16
+ "#{sudo} #{source.sync(revision, repository_cache)}; " +
17
+ "else #{sudo} #{source.checkout(revision, repository_cache)}; fi"
18
+ scm_run(command)
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/capistrano/recipes/deploy/strategy/remote_cache_with_sudo', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Genti Saliu"]
6
+ gem.email = ["genti.saliu@gmail.com"]
7
+ gem.description = %q{Capistrano Strategy for deployment of a project from source using sudo}
8
+ gem.summary = %q{Capistrano Strategy for deployment of a project from source using sudo}
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 = "remote-cache-with-sudo"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Capistrano::Deploy::Strategy::RemoteCacheWithSudo::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
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: remote-cache-with-sudo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Genti Saliu
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: !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: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '2.7'
30
+ description: Capistrano Strategy for deployment of a project from source using sudo
31
+ email:
32
+ - genti.saliu@gmail.com
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - .gitignore
38
+ - .settings/org.eclipse.core.resources.prefs
39
+ - Gemfile
40
+ - README.md
41
+ - Rakefile
42
+ - lib/capistrano/recipes/deploy/strategy/remote_cache_with_sudo.rb
43
+ - remote-cache-with-sudo.gemspec
44
+ homepage: ''
45
+ licenses: []
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 1.8.24
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: Capistrano Strategy for deployment of a project from source using sudo
68
+ test_files: []