capistrano-nfs 0.2.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 32d22ff425feab0be8c9f9ce7470e9c09c4f7de4
4
+ data.tar.gz: f741896ef81a0f92a5e2f65285602b6739c93815
5
+ SHA512:
6
+ metadata.gz: 53fdfa0e17e45b6047dbd6cb49d38c201116ff12357dfb048b04b2ac8840d1371f3e5dd6d280a06ba6360538cf9cd6ee806ddf28692a38d727c84b696324f439
7
+ data.tar.gz: 1660b5eddac92b3f5291a4bf55d363787921bfdda22777e3156e4bdb0b0d6681ac91dbf1535f0e49417275f2f1f8237112491367ea2d0c324d5c7e6b2fe69cc4
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Guillaume GIORDANA
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all 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,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Capistrano::Nfs
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano/nfs`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano-nfs'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install capistrano-nfs
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/capistrano-nfs.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
@@ -0,0 +1,6 @@
1
+ require "capistrano/nfs/version"
2
+ require "capistrano/nfs/dsl"
3
+
4
+ include Capistrano::NFS::DSL
5
+
6
+ load File.expand_path("../tasks/utility.rake", __FILE__)
@@ -0,0 +1,31 @@
1
+ require "pathname"
2
+
3
+ module Capistrano
4
+ module NFS
5
+ module DSL
6
+
7
+ def nfs_path
8
+ Pathname.new fetch(:nfs_path, "#{shared_path}")
9
+ end
10
+
11
+ def linked_nfs_dirs(parent)
12
+ paths = fetch(:linked_nfs_dirs)
13
+ join_paths(parent, paths)
14
+ end
15
+
16
+ def linked_nfs_files(parent)
17
+ paths = fetch(:linked_nfs_files)
18
+ join_paths(parent, paths)
19
+ end
20
+
21
+ def linked_nfs_file_dirs(parent)
22
+ map_dirnames(linked_nfs_files(parent))
23
+ end
24
+
25
+ def linked_nfs_dir_parents(parent)
26
+ map_dirnames(linked_nfs_dirs(parent))
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module NFS
3
+ VERSION = "0.2.0"
4
+ end
5
+ end
@@ -0,0 +1,89 @@
1
+ after 'deploy:symlink:shared', 'symlink:linked_nfs_files'
2
+ after 'deploy:symlink:shared', 'symlink:linked_nfs_dirs'
3
+
4
+ after 'deploy:check', 'check:linked_nfs_dirs'
5
+ after 'deploy:check', 'check:make_linked_nfs_dirs'
6
+ after 'deploy:check', 'check:linked_nfs_files'
7
+
8
+ namespace :symlink do
9
+
10
+ desc "Symlink nfs directories"
11
+ task :linked_nfs_dirs do
12
+ next unless any? :linked_nfs_dirs
13
+ on release_roles :root do
14
+ execute :sudo, "/bin/mkdir", "-p", linked_nfs_dir_parents(release_path)
15
+ end
16
+ on release_roles :app do
17
+ execute :mkdir, "-p", linked_nfs_dir_parents(release_path)
18
+ end
19
+ on release_roles :all do
20
+ fetch(:linked_nfs_dirs).each do |dir|
21
+ target = release_path.join(dir)
22
+ source = nfs_path.join(dir)
23
+ next if test "[ -L #{target} ]"
24
+ execute :rm, "-rf", target if test "[ -d #{target} ]"
25
+ execute :ln, "-s", source, target
26
+ end
27
+ end
28
+ end
29
+
30
+ desc "Symlink linked files"
31
+ task :linked_nfs_files do
32
+ next unless any? :linked_nfs_files
33
+ on release_roles :root do
34
+ execute :sudo, "/bin/mkdir", "-p", linked_nfs_file_dirs(release_path)
35
+ end
36
+ on release_roles :app do
37
+ execute :mkdir, "-p", linked_nfs_file_dirs(release_path)
38
+ end
39
+ on release_roles :all do
40
+ fetch(:linked_nfs_files).each do |file|
41
+ target = release_path.join(file)
42
+ source = nfs_path.join(file)
43
+ next if test "[ -L #{target} ]"
44
+ execute :rm, target if test "[ -f #{target} ]"
45
+ execute :ln, "-s", source, target
46
+ end
47
+ end
48
+ end
49
+
50
+ end
51
+
52
+ namespace :check do
53
+
54
+ desc "Check directories to be linked exist in shared"
55
+ task :linked_nfs_dirs do
56
+ next unless any? :linked_nfs_dirs
57
+ on release_roles :root do
58
+ execute :sudo, "/bin/mkdir", "-p", linked_nfs_dirs(nfs_path)
59
+ end
60
+ on release_roles :app do
61
+ execute :mkdir, "-p", linked_nfs_dirs(nfs_path)
62
+ end
63
+ end
64
+
65
+ desc "Check directories of files to be linked exist in shared"
66
+ task :make_linked_nfs_dirs do
67
+ next unless any? :linked_nfs_files
68
+ on release_roles :root do
69
+ execute :sudo, "/bin/mkdir", "-p", linked_nfs_file_dirs(nfs_path)
70
+ end
71
+ on release_roles :app do
72
+ execute :mkdir, "-p", linked_nfs_file_dirs(nfs_path)
73
+ end
74
+ end
75
+
76
+ desc "Check files to be linked exist in shared"
77
+ task :linked_nfs_files do
78
+ next unless any? :linked_nfs_files
79
+ on release_roles :all do |host|
80
+ linked_nfs_files(nfs_path).each do |file|
81
+ unless test "[ -f #{file} ]"
82
+ error t(:linked_nfs_file_does_not_exist, file: file, host: host)
83
+ exit 1
84
+ end
85
+ end
86
+ end
87
+ end
88
+
89
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-nfs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Guillaume GIORDANA
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-19 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.1.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 4.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 3.1.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 4.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.13'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.13'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ description: Enables the declaration of an additionnal shared folder
62
+ email:
63
+ - guillaume.giordana@gmail.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - LICENSE.txt
69
+ - README.md
70
+ - lib/capistrano/nfs.rb
71
+ - lib/capistrano/nfs/dsl.rb
72
+ - lib/capistrano/nfs/version.rb
73
+ - lib/capistrano/tasks/utility.rake
74
+ homepage: https://github.com/guillaumegiordana/capistrano-nfs
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.5.1
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: NFS shared folder for capistrano
98
+ test_files: []