capistrano-shared-file 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6d6ae7cca5e88ce73dd40c816479d47a41ad83ce
4
+ data.tar.gz: 21b380dd41c82f57bda78e18768dff14743ff6fd
5
+ SHA512:
6
+ metadata.gz: a14c62ee0bc5bdb0a9886205c9faf313119235bfa56cba9cea491ae05489d49bd3cc84d1fe67e961e1f13713d697b0a339666cf3b21d99c6df274a46dc22e278
7
+ data.tar.gz: 4d11dcb6f8e8a3f586f074d0dde2e04499b549771fa152e27d92ee36966e941b938bb7134206984fe570f69d7b17b18f890469faca5555f1daa723b18d2f06be
data/.gitignore ADDED
@@ -0,0 +1,49 @@
1
+ # rcov generated
2
+ coverage
3
+ coverage.data
4
+
5
+ # rdoc generated
6
+ rdoc
7
+
8
+ # yard generated
9
+ doc
10
+ .yardoc
11
+
12
+ # bundler
13
+ .bundle
14
+
15
+ # jeweler generated
16
+ pkg
17
+
18
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
19
+ #
20
+ # * Create a file at ~/.gitignore
21
+ # * Include files you want ignored
22
+ # * Run: git config --global core.excludesfile ~/.gitignore
23
+ #
24
+ # After doing this, these files will be ignored in all your git projects,
25
+ # saving you from having to 'pollute' every project you touch with them
26
+ #
27
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
28
+ #
29
+ # For MacOS:
30
+ #
31
+ #.DS_Store
32
+
33
+ # For TextMate
34
+ #*.tmproj
35
+ #tmtags
36
+
37
+ # For emacs:
38
+ #*~
39
+ #\#*
40
+ #.\#*
41
+
42
+ # For vim:
43
+ #*.swp
44
+
45
+ # For redcar:
46
+ #.redcar
47
+
48
+ # For rubinius:
49
+ #*.rbc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in klarna-client.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,29 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-shared-file (0.1.1)
5
+ capistrano (>= 2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ capistrano (2.15.5)
11
+ highline
12
+ net-scp (>= 1.0.0)
13
+ net-sftp (>= 2.0.0)
14
+ net-ssh (>= 2.0.14)
15
+ net-ssh-gateway (>= 1.1.0)
16
+ highline (1.6.19)
17
+ net-scp (1.1.2)
18
+ net-ssh (>= 2.6.5)
19
+ net-sftp (2.1.2)
20
+ net-ssh (>= 2.6.5)
21
+ net-ssh (2.6.8)
22
+ net-ssh-gateway (1.2.0)
23
+ net-ssh (>= 2.6.5)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ capistrano-shared-file!
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Daniel Salmeron Amselem
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # capistrano-shared-file
2
+ A Capistrano recipe to upload, download and symlink configuration files like `config/database.yml` or `config/application.yml` to or from your remote servers. Heavily inspired by teohm's [capistrano-shared_file](https://github.com/teohm/capistrano-shared_file) gem.
3
+
4
+ ## Install
5
+
6
+ gem install capistrano-shared-file
7
+
8
+ For Bundler, add this to your `Gemfile`:
9
+
10
+ gem 'capistrano-shared-file'
11
+
12
+ ## Usage
13
+
14
+ Add the following lines to `config/deploy.rb`:
15
+
16
+ set :shared_files, %w(config/database.yml)
17
+ require 'capistrano-shared-file'
18
+
19
+ ## Tasks
20
+
21
+ To upload all the files defined in the `shared_files` capistrano variable to a remote server, you can simply execute:
22
+
23
+ bundle exec cap shared_file:upload
24
+
25
+ To download all the files defined in the `shared_files` capistrano variable from a remote server, you can simply execute:
26
+
27
+ bundle exec cap shared_file:download
28
+
29
+ **Note**: You can use it together with `capistrano/ext/multistage` like:
30
+
31
+ bundle exec cap <STAGE> shared_file:upload
32
+ bundle exec cap <STAGE> shared_file:download
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/shared_file/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "capistrano-shared-file"
8
+ gem.version = Capistrano::SharedFile::VERSION
9
+ gem.authors = ["Daniel Salmeron Amselem"]
10
+ gem.email = ["daniel.amselem@gmail.com"]
11
+ gem.description = %q{Capistrano recipe to upload, download and symlink shared files.}
12
+ gem.summary = %q{Capistrano recipe to upload, download and symlink shared files.}
13
+ gem.homepage = "http://github.com/damselem/capistrano-shared-file"
14
+ gem.licenses = ['MIT']
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+
21
+ gem.add_dependency 'capistrano', '>= 2.0'
22
+ end
23
+
24
+
@@ -0,0 +1,2 @@
1
+ require 'capistrano/shared_file/version'
2
+ require 'capistrano/shared_file/tasks'
@@ -0,0 +1,51 @@
1
+ require 'capistrano'
2
+
3
+ unless Capistrano::Configuration.respond_to?(:instance)
4
+ abort 'capistrano/shared_file requires Capistrano 2'
5
+ end
6
+
7
+ Capistrano::Configuration.instance.load do
8
+
9
+ _cset :shared_files, %w(config/database.yml)
10
+ _cset :shared_file_dir, 'files'
11
+
12
+ def remote_path_to(file)
13
+ File.join(shared_path, shared_file_dir, file)
14
+ end
15
+
16
+ namespace :shared_file do
17
+
18
+ desc 'Generate remote directories for shared files.'
19
+ task :setup, :except => { :no_release => true } do
20
+ shared_files.each do |file|
21
+ run "#{try_sudo} mkdir -p #{remote_path_to(File.dirname(file))}"
22
+ run "#{try_sudo} chmod g+w #{remote_path_to(File.dirname(file))}" if fetch(:group_writable, true)
23
+ end
24
+ end
25
+ after 'deploy:setup', 'shared_file:setup.'
26
+
27
+ desc 'Upload shared files to server'
28
+ task :upload, :except => { :no_release => true } do
29
+ shared_files.each do |file|
30
+ top.upload(file, remote_path_to(file), :via => :scp)
31
+ end
32
+ end
33
+
34
+ desc 'Download shared files from server.'
35
+ task :download, :except => { :no_release => true } do
36
+ shared_files.each do |file|
37
+ top.download(remote_path_to(file), file, :via => :scp)
38
+ end
39
+ end
40
+
41
+ desc 'Symlink remote shared files to the current release directory.'
42
+ task :symlink, :except => { :no_release => true } do
43
+ shared_files.each do |file|
44
+ run "ln -nfs #{remote_path_to(file)} #{release_path}/#{file}"
45
+ end
46
+ end
47
+ after 'deploy:finalize_update', 'shared_file:symlink'
48
+
49
+ end
50
+
51
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module SharedFile
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-shared-file
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Salmeron Amselem
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-28 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: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ description: Capistrano recipe to upload, download and symlink shared files.
28
+ email:
29
+ - daniel.amselem@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - .gitignore
35
+ - Gemfile
36
+ - Gemfile.lock
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - capistrano-shared-file.gemspec
41
+ - lib/capistrano-shared-file.rb
42
+ - lib/capistrano/shared_file/tasks.rb
43
+ - lib/capistrano/shared_file/version.rb
44
+ homepage: http://github.com/damselem/capistrano-shared-file
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.0.3
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Capistrano recipe to upload, download and symlink shared files.
68
+ test_files: []