capistrano-rails-collection 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -4
- data/capistrano-rails-collection.gemspec +1 -2
- data/lib/capistrano/rails/collection.rb +1 -5
- data/lib/capistrano/rails/collection/general.rb +1 -0
- data/lib/capistrano/tasks/db.rake +69 -9
- data/lib/capistrano/tasks/general.rake +29 -0
- metadata +3 -2
- data/lib/capistrano/rails/collection/version.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2362d53a86985398e3cb848ba15e095f5bf46e2e
|
4
|
+
data.tar.gz: f9c43c04a5a2136c54155fe78ce827003be6fd3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe42d55211f9eb9671fa22cfe15d5f66f4a6a32e88b35b4267b8c9cc00c078414cc19356544554208384850cd8d79d563415ee17efbc5424aba504e140f22fa6
|
7
|
+
data.tar.gz: ef95242b81a8579b802932d8f83fd91f6139e50b6a974c6b0def06f08cb3984f21df9e4fbed7192a30b6d2cbd05cc0a9c22612e4a786e86d94eeb179ef4ef296
|
data/README.md
CHANGED
@@ -2,7 +2,14 @@
|
|
2
2
|
|
3
3
|
Rails specific task collection for Capistrano v3 as extension of the official capistrano rails gem:
|
4
4
|
|
5
|
-
* cap
|
5
|
+
* cap rails:rake:log:clear
|
6
|
+
* cap rails:rake:tmp:clear
|
7
|
+
* cap rails:rake:db:drop
|
8
|
+
* cap rails:rake:db:reset
|
9
|
+
* cap rails:rake:db:setup
|
10
|
+
* cap rails:rake:db:seed
|
11
|
+
* cap rails:rake:db:migrate
|
12
|
+
* cap rails:rake:db:rollback
|
6
13
|
|
7
14
|
## Installation
|
8
15
|
|
@@ -16,11 +23,12 @@ And then execute:
|
|
16
23
|
|
17
24
|
## Usage
|
18
25
|
|
19
|
-
|
26
|
+
This gem provides a collection of tasks for any Rails application. Make sure to use the `capistrano-rails` gem for deployment tasks.
|
27
|
+
|
28
|
+
Require the whole collection of Rails tasks.
|
20
29
|
|
21
30
|
```ruby
|
22
31
|
# Capfile
|
23
|
-
require 'capistrano/rails'
|
24
32
|
require 'capistrano/rails/collection'
|
25
33
|
```
|
26
34
|
|
@@ -32,4 +40,4 @@ Please note that any require should be placed in Capfile, not config/deploy.rb.
|
|
32
40
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
41
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
42
|
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
-
5. Create new Pull Request
|
43
|
+
5. Create new Pull Request
|
@@ -1,11 +1,10 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'capistrano/rails/collection/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
6
|
spec.name = "capistrano-rails-collection"
|
8
|
-
spec.version =
|
7
|
+
spec.version = "0.0.2"
|
9
8
|
spec.authors = ["dei79"]
|
10
9
|
spec.email = ["dirk.eisenberg@gmail.com"]
|
11
10
|
spec.description = %q{Rails specific Capistrano tasks which are not part of the official rails gem}
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../../../tasks/general.rake", __FILE__)
|
@@ -1,14 +1,74 @@
|
|
1
|
-
namespace :
|
1
|
+
namespace :rails do
|
2
|
+
namespace :rake do
|
3
|
+
namespace :db do
|
4
|
+
desc 'Drops the database to an empty state'
|
5
|
+
task :drop do
|
6
|
+
on primary :db do
|
7
|
+
within current_path do
|
8
|
+
with rails_env: fetch(:stage) do
|
9
|
+
execute :rake, 'db:drop'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'Resets the database to an empty state'
|
16
|
+
task :reset do
|
17
|
+
on primary :db do
|
18
|
+
within current_path do
|
19
|
+
with rails_env: fetch(:stage) do
|
20
|
+
execute :rake, 'db:reset'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc <<-DESC
|
27
|
+
Create the database, load the schema, and initialize with the seed data \
|
28
|
+
(use db:reset to also drop the db first)
|
29
|
+
DESC
|
30
|
+
task :setup do
|
31
|
+
on primary :db do
|
32
|
+
within current_path do
|
33
|
+
with rails_env: fetch(:stage) do
|
34
|
+
execute :rake, 'db:setup'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
2
39
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
40
|
+
desc "Load the seed data from db/seeds.rb"
|
41
|
+
task :seed do
|
42
|
+
on primary :db do
|
43
|
+
within current_path do
|
44
|
+
with rails_env: fetch(:stage) do
|
45
|
+
execute :rake, 'db:seed'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
desc "Migrate the database"
|
52
|
+
task :rollback do
|
53
|
+
on primary :db do
|
54
|
+
within current_path do
|
55
|
+
with rails_env: fetch(:stage) do
|
56
|
+
execute :rake, 'db:migrate'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Rolls the schema back to the previous version"
|
63
|
+
task :rollback do
|
64
|
+
on primary :db do
|
65
|
+
within current_path do
|
66
|
+
with rails_env: fetch(:stage) do
|
67
|
+
execute :rake, 'db:rollback'
|
68
|
+
end
|
69
|
+
end
|
9
70
|
end
|
10
71
|
end
|
11
72
|
end
|
12
73
|
end
|
13
|
-
|
14
|
-
end
|
74
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
namespace :rails do
|
2
|
+
namespace :rake do
|
3
|
+
namespace :log do
|
4
|
+
desc 'Truncates all *.log files in log/ to zero bytes'
|
5
|
+
task :clear do
|
6
|
+
on primary :db do
|
7
|
+
within current_path do
|
8
|
+
with rails_env: fetch(:stage) do
|
9
|
+
execute :rake, 'log:clear'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
namespace :tmp do
|
17
|
+
desc 'Clear session, cache, and socket files from tmp/'
|
18
|
+
task :clear do
|
19
|
+
on primary :db do
|
20
|
+
within current_path do
|
21
|
+
with rails_env: fetch(:stage) do
|
22
|
+
execute :rake, 'tmp:clear'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-rails-collection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dei79
|
@@ -41,8 +41,9 @@ files:
|
|
41
41
|
- lib/capistrano-rails-collection.rb
|
42
42
|
- lib/capistrano/rails/collection.rb
|
43
43
|
- lib/capistrano/rails/collection/db.rb
|
44
|
-
- lib/capistrano/rails/collection/
|
44
|
+
- lib/capistrano/rails/collection/general.rb
|
45
45
|
- lib/capistrano/tasks/db.rake
|
46
|
+
- lib/capistrano/tasks/general.rake
|
46
47
|
homepage: ''
|
47
48
|
licenses:
|
48
49
|
- MIT
|