capistrano-rdws 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25b7fdcc8da700b84d747af125b75b492a5c2601
4
- data.tar.gz: 5e19ffc91375af9c65eaa725f2ef79aaccb6405b
3
+ metadata.gz: a55dd88c156e97ea8361e632449401fdcf8a1a51
4
+ data.tar.gz: 832a40729c8b855620b09d7b0234edd5d1fc457f
5
5
  SHA512:
6
- metadata.gz: 47ea574af62912c0235d45c498ca5b1d9a513db76e2136fecdc70f0a3b562fbcc944a8abf5e0d4a094366f40d5158b4a4a0beebb309b2e4e261e34a89bfaae2e
7
- data.tar.gz: f4753dbf01fbf4da344226b291acb21bce4ee3473a5b7cdbead12d768d5b7cf2ba600d7871d3d8a9217ff7f2516f50d01f10ff643cba03891876b4c36a09e088
6
+ metadata.gz: ebdd590f6e53627f7f5b66c6fa241d2d8c32e6f1c22c5a377f54b9361d2eeb480ec8f8ea4bbb8bc97a6ebba6515de1dec8cae35ed6152b8cbc1094a76243d29a
7
+ data.tar.gz: e456a774ec4263655c0c3249fa912da60a662486468ce507e8d383d47fb2cc2d32c9f72319971d49407ef64b2e6655bb1265044cb1f8560924467e0e8b63dae9
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Capistrano::Rdws
2
2
 
3
- TODO: Write a gem description
3
+ Bunch of capistrano v3.x tasks
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,10 +18,12 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- List of tasks:
21
+ Full list of tasks (description of each below):
22
22
 
23
23
  $ cap db:data:dump
24
+ $ cap db:data:fetch_fresh_dump
24
25
  $ cap db:create
26
+ $ cap db:reset_db
25
27
 
26
28
  $ cap release:pack
27
29
 
@@ -32,11 +34,22 @@ List of tasks:
32
34
 
33
35
  $ cap logs:tail[logfile]
34
36
 
37
+ ### Db tasks
38
+
39
+ #### Data tasks (connected with yaml_db gem)
40
+ Make `rake db:data:dump` task on server:
41
+
42
+ $ cap db:data:dump
43
+
44
+ Effect of `cap db:data:dump` task plus download `data.yml` into local `db/` application directory:
45
+
46
+ $ cap db:data:fetch_fresh_dump
47
+
35
48
  ## TODO
36
49
 
37
50
  1. Test db existance for 'cap db:create'
38
- 2. Add task for synchronising public/uploads and public/system
39
- 3. Add task for download fresh dump (from yaml_db)
51
+ 2. Add task for synchronising public/uploads and public/system (between any 2 environments)
52
+ 3. Add task for download fresh dump (with yaml_db) from production to staging
40
53
 
41
54
  ## Contributing
42
55
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Rdws
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -10,6 +10,19 @@ namespace :db do
10
10
  end
11
11
  end
12
12
  end
13
+
14
+ desc 'Make yaml_db dump and copy it on development machine'
15
+ task :fetch_fresh_dump do
16
+ invoke "db:data:dump"
17
+
18
+ user = roles(:web)[0].user
19
+ hostname = roles(:web)[0].hostname
20
+ port = fetch(:ssh_options)[:port]
21
+
22
+ run_locally do
23
+ execute "scp -P #{port} #{user}@#{hostname}:#{current_path}/db/data.yml db/"
24
+ end
25
+ end
13
26
  end
14
27
 
15
28
  desc 'create db'
@@ -27,4 +40,23 @@ namespace :db do
27
40
  end
28
41
  end
29
42
 
43
+ desc 'reset db'
44
+ task :reset_db do
45
+
46
+ on roles(:db) do
47
+ within release_path do
48
+ with rails_env: fetch(:stage) do
49
+ # add test for existing db
50
+ # if test
51
+ ask(:make_reset_db?, "yes[y]да[д]")
52
+ if %(yes y д да).include? fetch(:make_reset_db?)
53
+ execute :rake, "db:reset_db"
54
+ end
55
+ # else
56
+ # end
57
+ end
58
+ end
59
+ end
60
+ end
61
+
30
62
  end
@@ -4,7 +4,6 @@ namespace :load do
4
4
  end
5
5
  end
6
6
 
7
-
8
7
  namespace :unicorn do
9
8
 
10
9
  def run_unicorn
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-rdws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rydkin Maxim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-22 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler