capistrano-simple-shared-files 0.1.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 +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +59 -0
- data/Rakefile +1 -0
- data/capistrano-simple-shared-files.gemspec +22 -0
- data/lib/capistrano-simple-shared-files.rb +0 -0
- data/lib/capistrano/simple_shared_files.rb +1 -0
- data/lib/capistrano/tasks/simple_shared_files.rake +33 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 89a4bf9de33d75f544fa3c63941cc4d1fa6e760d
|
4
|
+
data.tar.gz: cb969becb7ab8cc39c972193fc18402ad100e65e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b18f8e46782e91fc6f685553ea2e5b6cf4527ea3e9f1b66b74a837671ae5930ea20939e1f539c08f33a05a74a8910fd632f5d3abac7fc5b2b66da5c0fb232be5
|
7
|
+
data.tar.gz: 4eff31bf5bb1585cae1d4849e753cc7810e561a20f544b2c04a880d42416ab6360e48a290fc4623227aa8e153bd1750b06ef066ca7fe29cf76fa0b883e6be80f
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Runar Skaare Tveiten
|
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 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,
|
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# capistrano-simple-shared-files
|
2
|
+
|
3
|
+
This gem provides Capistrano recipes to upload your linked files and directories. Linked files and directories are placed in the `shared` directory on your remote servers and kept between deployments. After a new deployment, a symlink is created from the `shared` directory to the `current` directory.
|
4
|
+
|
5
|
+
This is an adaptation from runar's [capistrano-linked-files](https://github.com/runar/capistrano-linked-files) which is inspired in damselem's [capistrano-shared-files](https://github.com/damselem/capistrano-shared-file). This gem applies the philosophy of the second one with the simpler, easier code of the first.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add the gem to your `Gemfile`:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'capistrano-simple-shared-files'
|
13
|
+
```
|
14
|
+
|
15
|
+
Or install it to your system:
|
16
|
+
|
17
|
+
```
|
18
|
+
$ gem install capistrano-simple-shared-files
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Add the gem to your `Capfile`:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'capistrano/simple_shared_files'
|
27
|
+
```
|
28
|
+
|
29
|
+
In `deploy.rb`, list the files and directories you'd like to keep between deployments:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
set :shared_files, %w(config/database.yml config/secrets.yml)
|
33
|
+
set :shared_dirs, %w(bin tmp)
|
34
|
+
```
|
35
|
+
|
36
|
+
Then run the task:
|
37
|
+
|
38
|
+
```
|
39
|
+
$ bundle exec cap <stage> simple_shared_files:upload
|
40
|
+
```
|
41
|
+
|
42
|
+
To automatically upload linked files and directories before a new deployment, add the following to your `deploy.rb`:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
before 'deploy:starting', 'simple_shared_files:upload'
|
46
|
+
```
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
1. Fork it
|
51
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
52
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
53
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
54
|
+
5. Create a new Pull Request
|
55
|
+
|
56
|
+
## License
|
57
|
+
|
58
|
+
The capistrano-linked-files plugin is free software released under the MIT License.
|
59
|
+
See [LICENSE](https://github.com/runar/capistrano-linked-files/blob/master/LICENSE) for details.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'capistrano-simple-shared-files'
|
6
|
+
s.version = '0.1.0'
|
7
|
+
s.summary = 'Upload files and directories to shared directory.'
|
8
|
+
s.description = 'Adds tasks to upload files and directories to shared directory.'
|
9
|
+
|
10
|
+
s.authors = ['Pablo Torrecilla']
|
11
|
+
s.email = ['pau@nosolopau.com']
|
12
|
+
s.homepage = 'https://github.com/nosolopau/capistrano-simple-shared-files'
|
13
|
+
s.license = 'MIT'
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split($/)
|
16
|
+
s.require_paths = ['lib']
|
17
|
+
|
18
|
+
s.add_dependency 'capistrano', '~> 3.1'
|
19
|
+
|
20
|
+
s.add_development_dependency 'bundler'
|
21
|
+
s.add_development_dependency 'rake'
|
22
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/simple_shared_files.rake', __FILE__)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
namespace :simple_shared_files do
|
2
|
+
|
3
|
+
desc 'Upload files and directories'
|
4
|
+
task :upload do
|
5
|
+
invoke 'simple_shared_files:upload:files'
|
6
|
+
invoke 'simple_shared_files:upload:dirs'
|
7
|
+
end
|
8
|
+
|
9
|
+
namespace :upload do
|
10
|
+
|
11
|
+
task :files do
|
12
|
+
on roles :web do
|
13
|
+
if fetch(:shared_files)
|
14
|
+
fetch(:shared_files).each do |file|
|
15
|
+
upload! file, "#{shared_path}/#{file}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
task :dirs do
|
22
|
+
on roles :web do
|
23
|
+
if fetch(:shared_dirs)
|
24
|
+
fetch(:shared_dirs).each do |dir|
|
25
|
+
upload! dir, "#{shared_path}/", recursive: true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
before 'simple_shared_files:upload', 'deploy:check:make_linked_dirs'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-simple-shared-files
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pablo Torrecilla
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-13 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'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
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: Adds tasks to upload files and directories to shared directory.
|
56
|
+
email:
|
57
|
+
- pau@nosolopau.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- .gitignore
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- capistrano-simple-shared-files.gemspec
|
68
|
+
- lib/capistrano-simple-shared-files.rb
|
69
|
+
- lib/capistrano/simple_shared_files.rb
|
70
|
+
- lib/capistrano/tasks/simple_shared_files.rake
|
71
|
+
homepage: https://github.com/nosolopau/capistrano-simple-shared-files
|
72
|
+
licenses:
|
73
|
+
- MIT
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.0.14
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: Upload files and directories to shared directory.
|
95
|
+
test_files: []
|