capistrano-rails-db 0.0.1
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 +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +42 -0
- data/Rakefile +1 -0
- data/capistrano-rails-db.gemspec +20 -0
- data/lib/capistrano-rails-db.rb +0 -0
- data/lib/capistrano/rails/db.rb +1 -0
- data/lib/capistrano/tasks/db.rake +54 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4f35191b071a5b9b2a665a789757f3a1c4636ae7
|
4
|
+
data.tar.gz: a67bcb5dacf5f6af9fff8d71bbc7e05fbf6bc023
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b0e1556f9a98dd07487afa7aeb8f3a6a0e321581d006dc5b07574fe4d5a4619df30439f51bf3cc249303da8f56567af501775a7a429e35fdfcd674ae09388d34
|
7
|
+
data.tar.gz: 4f81217f605fd21814cb5927f4a077d1ab3c0a419f05115afbb99ba04cf788635aaa2d93923a36a62277579a775ee20931cc69bf510f2258976f881e95d07c44
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Kentaro Imai
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Capistrano::Rails:Db
|
2
|
+
|
3
|
+
Rails migration tasks for Capistrano v3:
|
4
|
+
|
5
|
+
- `cap deploy:db:abort_if_pending_migrations`
|
6
|
+
- `cap deploy:db:create`
|
7
|
+
- `cap deploy:db:drop`
|
8
|
+
- `cap deploy:db:migrate`
|
9
|
+
- `cap deploy:db:migrate:down`
|
10
|
+
- `cap deploy:db:migrate:redo`
|
11
|
+
- `cap deploy:db:migrate:reset`
|
12
|
+
- `cap deploy:db:migrate:status`
|
13
|
+
- `cap deploy:db:migrate:up`
|
14
|
+
- `cap deploy:db:reset`
|
15
|
+
- `cap deploy:db:rollback`
|
16
|
+
- `cap deploy:db:seed`
|
17
|
+
- `cap deploy:db:setup`
|
18
|
+
- `cap deploy:db:version`
|
19
|
+
|
20
|
+
## Installation
|
21
|
+
|
22
|
+
Add this line to your application's Gemfile:
|
23
|
+
|
24
|
+
gem 'capistrano', '~> 3.1'
|
25
|
+
gem 'capistrano-rails', '~> 1.1'
|
26
|
+
gem 'capistrano-rails-db'
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
# Capfile
|
31
|
+
require 'capistrano/rails'
|
32
|
+
require 'capistrano/rails/db'
|
33
|
+
|
34
|
+
Please note that any `require` should be placed in `Capfile`, not `config/deploy.rb`.
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
1. Fork it
|
39
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
40
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
41
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
42
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = "capistrano-rails-db"
|
7
|
+
gem.version = '0.0.1'
|
8
|
+
gem.authors = ["Kentaro Imai"]
|
9
|
+
gem.email = ["kentaroi@gmail.com"]
|
10
|
+
gem.description = %q{Rails migration tasks for Capistrano v3}
|
11
|
+
gem.summary = %q{Rails migration tasks for Capistrano v3}
|
12
|
+
gem.homepage = "https://github.com/kentaroi/capistrano-rails-db"
|
13
|
+
|
14
|
+
gem.files = `git ls-files`.split($/)
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.require_paths = ["lib"]
|
17
|
+
|
18
|
+
gem.add_dependency 'capistrano-rails', '~> 1.1'
|
19
|
+
|
20
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../../tasks/db.rake', __FILE__)
|
@@ -0,0 +1,54 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
namespace :db do
|
3
|
+
task :set_rails_db_options do
|
4
|
+
set :rails_db_options, [ ENV['VERSION'] ? "VERSION=#{ENV['VERSION']}" : nil,
|
5
|
+
ENV['VERBOSE'] ? "VERBOSE=#{ENV['VERBOSE']}" : nil,
|
6
|
+
ENV['SCOPE'] ? "SCOPE=#{ENV['SCOPE']}" : nil,
|
7
|
+
ENV['STEP'] ? "STEP=#{ENV['STEP']}" : nil ].compact
|
8
|
+
end
|
9
|
+
|
10
|
+
{ abort_if_pending_migrations: '',
|
11
|
+
create: '',
|
12
|
+
drop: '',
|
13
|
+
migrate: 'Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog).',
|
14
|
+
rollback: 'Roll the schema back to the previous version (specify steps w/ STEP=n).',
|
15
|
+
seed: 'Load the seed data from db/seed.rb',
|
16
|
+
setup: 'Create the database, load the schema, and initialize with the seed data',
|
17
|
+
reset: 'Drop and recreate the database from db/schema.rb and load the seeds',
|
18
|
+
version: 'Retrieve the current schema version number'
|
19
|
+
}.each do |task_name, task_desc|
|
20
|
+
desc "Run rake db:#{task_name}".ljust(29) + task_desc
|
21
|
+
task task_name => [:set_rails_env, :set_rails_db_options] do
|
22
|
+
on primary fetch(:migration_role) do
|
23
|
+
info "[deploy:db:#{task_name}] Run `rake db:#{task_name}`"
|
24
|
+
within release_path do
|
25
|
+
with rails_env: fetch(:rails_env) do
|
26
|
+
execute :rake, "db:#{task_name}", *fetch(:rails_db_options)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
namespace :migrate do
|
34
|
+
{ status: 'Display status of migrations',
|
35
|
+
up: 'Run the "up" for a given migration VERSION.',
|
36
|
+
down: 'Run the "down" for a given migration VERSION.',
|
37
|
+
redo: 'Rollback the database one migration and re migrate up (options: STEP=x, VERSION=x).',
|
38
|
+
reset: 'Reset your database using your migrations'
|
39
|
+
}.each do |task_name, task_desc|
|
40
|
+
desc "Run rake db:migrate:#{task_name}".ljust(29) + task_desc
|
41
|
+
task task_name => [:set_rails_env, :set_rails_db_options] do
|
42
|
+
on primary fetch(:migration_role) do
|
43
|
+
info "[deploy:db:migrate:#{task_name}] Run `rake db:migrate:#{task_name}`"
|
44
|
+
within release_path do
|
45
|
+
with rails_env: fetch(:rails_env) do
|
46
|
+
execute :rake, "db:migrate:#{task_name}", *fetch(:rails_db_options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-rails-db
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kentaro Imai
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano-rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.1'
|
27
|
+
description: Rails migration tasks for Capistrano v3
|
28
|
+
email:
|
29
|
+
- kentaroi@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- Gemfile
|
36
|
+
- LICENSE.txt
|
37
|
+
- README.md
|
38
|
+
- Rakefile
|
39
|
+
- capistrano-rails-db.gemspec
|
40
|
+
- lib/capistrano-rails-db.rb
|
41
|
+
- lib/capistrano/rails/db.rb
|
42
|
+
- lib/capistrano/tasks/db.rake
|
43
|
+
homepage: https://github.com/kentaroi/capistrano-rails-db
|
44
|
+
licenses: []
|
45
|
+
metadata: {}
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
requirements: []
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 2.2.2
|
63
|
+
signing_key:
|
64
|
+
specification_version: 4
|
65
|
+
summary: Rails migration tasks for Capistrano v3
|
66
|
+
test_files: []
|