j-cap-recipes 0.0.12 → 0.0.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19205ae6c03c28ca13a83714b53978c2304158f0
4
- data.tar.gz: ff0540435712a918aef2e8a4574dbfcb53289d42
3
+ metadata.gz: 0a5ce42fee65e8aeb412a3f5049ee9022d76da70
4
+ data.tar.gz: 370ad71ab61b0d638725e452a171c03fa9ba94bd
5
5
  SHA512:
6
- metadata.gz: 3d72d9d5ef4f5abd01a9a2a1caf6bd4b39aebb9ac3d469f7b50e6c33505f51bd5e65d83fb147c8ee07dcc06e593a25d254cd6a7b857b78755d72cbadc21ca466
7
- data.tar.gz: efbb9f9e7ea187af3dfc06ec6f07f8177a4b25906f59d91b0c6f15bfbb937599ec71569b65d49bfec2a4756c4f987021f2ad35d4af930118c27f96e86b31c0d5
6
+ metadata.gz: 2aafc607283fa25bb77b47599ae94ed3b0cf0bfe3f6f6bc22fc4a9eaa56cfc8aff83611b29865f5f7f03ce6809a7a7880514bf8e57fbf083fc22ed66d75276d9
7
+ data.tar.gz: 1502e1f91de548eaf623ba6f49dc27affe0218fbeda5c406b1048a5066429505d283f9db2ba4631c3b93416e068f6f39b1a5eca6a60b51001c4eafe9c946d7e9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- j-cap-recipes (0.0.12)
4
+ j-cap-recipes (0.0.13)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -1 +1 @@
1
- load File.expand_path("../tasks/check.rake", __FILE__)
1
+ load File.expand_path('../tasks/check.rake', __FILE__)
@@ -1 +1 @@
1
- load File.expand_path("../tasks/database.rake", __FILE__)
1
+ load File.expand_path('../tasks/database.rake', __FILE__)
@@ -1 +1 @@
1
- load File.expand_path("../tasks/delayed_job.rake", __FILE__)
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
@@ -0,0 +1,8 @@
1
+ namespace :deploy do
2
+ desc 'Restart application'
3
+ task :restart do
4
+ on roles(:app), in: :sequence, wait: 5 do
5
+ execute :touch, current_path.join('tmp/restart.txt')
6
+ end
7
+ end
8
+ 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
- download! "#{shared_path}/#{args[:path]}", '.', recursive: true, verbose: true
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
@@ -1,5 +1,5 @@
1
1
  module JCap
2
2
  module Recipes
3
- VERSION = '0.0.12'
3
+ VERSION = '0.0.13'
4
4
  end
5
5
  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.12
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-01-22 00:00:00.000000000 Z
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