j-cap-recipes 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +13 -0
- data/lib/j-cap-recipes/check.rb +1 -1
- data/lib/j-cap-recipes/database.rb +1 -1
- data/lib/j-cap-recipes/delayed_job.rb +1 -1
- data/lib/j-cap-recipes/deploy.rb +1 -0
- data/lib/j-cap-recipes/tasks/database.rake +1 -0
- data/lib/j-cap-recipes/tasks/deploy.rake +8 -0
- data/lib/j-cap-recipes/tasks/files.rake +15 -1
- data/lib/j-cap-recipes/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a5ce42fee65e8aeb412a3f5049ee9022d76da70
|
4
|
+
data.tar.gz: 370ad71ab61b0d638725e452a171c03fa9ba94bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aafc607283fa25bb77b47599ae94ed3b0cf0bfe3f6f6bc22fc4a9eaa56cfc8aff83611b29865f5f7f03ce6809a7a7880514bf8e57fbf083fc22ed66d75276d9
|
7
|
+
data.tar.gz: 1502e1f91de548eaf623ba6f49dc27affe0218fbeda5c406b1048a5066429505d283f9db2ba4631c3b93416e068f6f39b1a5eca6a60b51001c4eafe9c946d7e9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -102,6 +102,19 @@ set :git_tag_name, proc { Time.now.to_s.gsub(/[\s\+]+/, '_') }
|
|
102
102
|
after 'deploy:finished', 'git:release:tag'
|
103
103
|
```
|
104
104
|
|
105
|
+
### Files
|
106
|
+
|
107
|
+
Add 'j-cap-recipes/git'` to `Capfile`.
|
108
|
+
And now you have task to download any remote file to local via:
|
109
|
+
`bundle exec cap staging "files:download[config/database.yml]"`.
|
110
|
+
You will find `download.tar` file in current directory with `config/database.yml`.
|
111
|
+
|
112
|
+
To download all share folder use:
|
113
|
+
`bundle exec cap staging "files:download[.]"`
|
114
|
+
|
115
|
+
To extract the archive `tar -xvf download.tar -C tmp`
|
116
|
+
|
117
|
+
|
105
118
|
## Contributing
|
106
119
|
|
107
120
|
1. Fork it
|
data/lib/j-cap-recipes/check.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
load File.expand_path(
|
1
|
+
load File.expand_path('../tasks/check.rake', __FILE__)
|
@@ -1 +1 @@
|
|
1
|
-
load File.expand_path(
|
1
|
+
load File.expand_path('../tasks/database.rake', __FILE__)
|
@@ -1 +1 @@
|
|
1
|
-
load File.expand_path(
|
1
|
+
load File.expand_path('../tasks/delayed_job.rake', __FILE__)
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/deploy.rake', __FILE__)
|
@@ -44,6 +44,7 @@ namespace :db do
|
|
44
44
|
task :dump_download do
|
45
45
|
on primary fetch(:migration_role) do
|
46
46
|
within release_path do
|
47
|
+
FileUtils.mkdir_p 'db/backups'
|
47
48
|
bakup_file = "db/backups/#{fetch(:application)}_#{fetch(:rails_env).to_s}_latest.dump"
|
48
49
|
download! "#{shared_path}/#{bakup_file}", bakup_file
|
49
50
|
end
|
@@ -1,9 +1,23 @@
|
|
1
1
|
namespace :files do
|
2
2
|
desc 'Downlaod remote shared files to local machine.'
|
3
3
|
task :download, :path do |task, args|
|
4
|
+
|
5
|
+
if args[:path].nil?
|
6
|
+
puts "You should provide the file path.\nExample: `cap #{fetch(:stage)} \"files:download[config/database.yml]\"`"
|
7
|
+
puts "If you want to download share folder use next: `cap #{fetch(:stage)} \"files:download[.]\"`"
|
8
|
+
exit
|
9
|
+
end
|
10
|
+
|
4
11
|
on primary fetch(:migration_role) do
|
12
|
+
info "Started downloading remote file '#{args[:path]}'"
|
5
13
|
within shared_path do
|
6
|
-
|
14
|
+
archive_path = '/tmp/download.tar'
|
15
|
+
info "Archive to #{archive_path}"
|
16
|
+
execute :tar, '-cvf', archive_path, args[:path]
|
17
|
+
info 'Downloading...'
|
18
|
+
download! archive_path, '.', recursive: true, verbose: true
|
19
|
+
info "Remove archive file #{archive_path}"
|
20
|
+
execute :rm, archive_path
|
7
21
|
end
|
8
22
|
end
|
9
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: j-cap-recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Nikitochkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/j-cap-recipes/check.rb
|
71
71
|
- lib/j-cap-recipes/database.rb
|
72
72
|
- lib/j-cap-recipes/delayed_job.rb
|
73
|
+
- lib/j-cap-recipes/deploy.rb
|
73
74
|
- lib/j-cap-recipes/files.rb
|
74
75
|
- lib/j-cap-recipes/git.rb
|
75
76
|
- lib/j-cap-recipes/handy.rb
|
@@ -84,6 +85,7 @@ files:
|
|
84
85
|
- lib/j-cap-recipes/tasks/check.rake
|
85
86
|
- lib/j-cap-recipes/tasks/database.rake
|
86
87
|
- lib/j-cap-recipes/tasks/delayed_job.rake
|
88
|
+
- lib/j-cap-recipes/tasks/deploy.rake
|
87
89
|
- lib/j-cap-recipes/tasks/files.rake
|
88
90
|
- lib/j-cap-recipes/tasks/git.rake
|
89
91
|
- lib/j-cap-recipes/tasks/handy.rake
|