capistrano-linked-files 0.1.0 → 1.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 +4 -4
- data/README.md +15 -1
- data/capistrano-linked-files.gemspec +1 -1
- data/lib/capistrano/tasks/linked_files.rake +6 -27
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5bde76f852c3dacf613dc1f1ff1d0efaeb29bc9
|
4
|
+
data.tar.gz: 0f61296236d70b88b8a7b2a7cd1ada7a43e716ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3eda4894c3634f2515af749165eff6c8c696528eeef06e18c0d294bef3421bc4b03004b2ce69184d7464b0e61f533806943160bcde32d347fb4fe0d67cf4489
|
7
|
+
data.tar.gz: d061dcf2827e023a6192a4b528e1178576cba9b0cf0a38d1d3268a260fa6820e2b051535effe19e3df7d357c6d7a0146f2cfdf5f401720033802488f710f9732
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# capistrano-linked-files
|
2
2
|
|
3
|
-
This gem provides Capistrano reciepes to upload your linked files and directories. It's quite useful for files such as `config/database.yml` and `config/secrets.yml`, which are usually ignored (at least they should be) from version control systems.
|
3
|
+
This gem provides Capistrano 3.1 reciepes to upload your linked files and directories. It's quite useful for files such as `config/database.yml` and `config/secrets.yml`, which are usually ignored (at least they should be) from version control systems.
|
4
4
|
|
5
5
|
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.
|
6
6
|
|
@@ -41,10 +41,24 @@ Then run the task:
|
|
41
41
|
$ bundle exec cap <STAGE> linked_files:upload
|
42
42
|
```
|
43
43
|
|
44
|
+
If you only want to upload files or dirs, then run the tasks accordingly:
|
45
|
+
|
46
|
+
```
|
47
|
+
$ bundle exec cap <STAGE> linked_files:upload_files
|
48
|
+
$ bundle exec cap <STAGE> linked_files:upload_dirs
|
49
|
+
```
|
50
|
+
|
44
51
|
To automatically upload linked files and directories after a new deployment, add the following to your `deploy.rb`:
|
45
52
|
|
46
53
|
```ruby
|
54
|
+
# Uploading both linked_files and dirs
|
47
55
|
before :finishing, 'linked_files:upload'
|
56
|
+
|
57
|
+
# Uploading only linked_files
|
58
|
+
before :finishing, 'linked_files:upload_files'
|
59
|
+
|
60
|
+
# Uploading only dirs
|
61
|
+
before :finishing, 'linked_files:upload_dirs'
|
48
62
|
```
|
49
63
|
|
50
64
|
## Contributing
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'capistrano-linked-files'
|
6
|
-
s.version = '
|
6
|
+
s.version = '1.1.0'
|
7
7
|
s.summary = 'Upload linked files and directories.'
|
8
8
|
s.description = 'Adds tasks to upload your linked files and directories. '
|
9
9
|
|
@@ -1,7 +1,3 @@
|
|
1
|
-
def backup_path_for(file)
|
2
|
-
File.join(File.dirname(file), "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{File.basename(file)}")
|
3
|
-
end
|
4
|
-
|
5
1
|
namespace :linked_files do
|
6
2
|
|
7
3
|
desc 'Upload linked files and directories'
|
@@ -9,6 +5,12 @@ namespace :linked_files do
|
|
9
5
|
invoke 'linked_files:upload:files'
|
10
6
|
invoke 'linked_files:upload:dirs'
|
11
7
|
end
|
8
|
+
task :upload_files do
|
9
|
+
invoke 'linked_files:upload:files'
|
10
|
+
end
|
11
|
+
task :upload_dirs do
|
12
|
+
invoke 'linked_files:upload:dirs'
|
13
|
+
end
|
12
14
|
|
13
15
|
namespace :upload do
|
14
16
|
|
@@ -30,29 +32,6 @@ namespace :linked_files do
|
|
30
32
|
|
31
33
|
end
|
32
34
|
|
33
|
-
namespace :backup do
|
34
|
-
|
35
|
-
desc 'Download a backup of remote linked files'
|
36
|
-
task :files do
|
37
|
-
on roles :web do
|
38
|
-
fetch(:linked_files).each do |file|
|
39
|
-
download! "#{shared_path}/#{file}", backup_path_for(file)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
desc 'Download a backup of remote linked directories'
|
45
|
-
task :dirs do
|
46
|
-
on roles :web do
|
47
|
-
fetch(:linked_dirs).each do |dir|
|
48
|
-
download! "#{shared_path}/#{dir}", "backups_#{dir}", recursive: true
|
49
|
-
# info "#{shared_path}/#{dir} #{backup_path_for(dir)}"
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
35
|
before 'linked_files:upload', 'deploy:check:make_linked_dirs'
|
57
36
|
|
58
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-linked-files
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Runar Skaare Tveiten
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.2.
|
91
|
+
rubygems_version: 2.2.2
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Upload linked files and directories.
|