mina-ridgepole 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d16ccfce61c73d58cc8cad952fe1367b90dfddf8
4
+ data.tar.gz: b1382a7a3bdec70550656fde81f97f100a54cd04
5
+ SHA512:
6
+ metadata.gz: 2b5581f5cf076281fe451c9ddb8b7e9ec96b2961338d45a560a134873e90cb05ce28f1e6547ce80c4f4e03217adfc0b1e84b47bab856da68583aace9c9dbfa97
7
+ data.tar.gz: 47ca1c90773a39fe6cb1c6961ed3d610aaab5d2e241177e9e7aa942f9c1f926664363b139ba271881ea1e32b00d147af612efe5a1e9fcb71728e89598f179900
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mina-ridgepole.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Isao Sugimoto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # Mina Ridgepole
2
+
3
+ * [Mina](https://github.com/nadarei/mina)
4
+ * [Ridgepole](https://github.com/winebarrel/ridgepole)
5
+
6
+ This gem provides mina task
7
+
8
+ mina ridgepole:apply # apply DB schema.
9
+ mina ridgepole:apply_dryrun # dry-run apply DB schema.
10
+ mina ridgepole:export # export DB schema.
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ gem 'mina-ridgepole', :require => false
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Or install it yourself as:
23
+
24
+ $ gem install mina-ridgepole
25
+
26
+ you can set other option by setting follow variables:
27
+
28
+ * `ridgepole_config` - ridgepole database file, default is `shared/config/database.yml`
29
+ * `ridgepole_schemafile` - ridgepole schemafile, default `Schemafile`
30
+ * `ridgepole_options` - ridgepole additional options, default `""`
31
+
32
+
33
+ ## Usage
34
+
35
+ Add this to your `config/deploy.rb` file:
36
+
37
+ require 'mina/ridgepole'
38
+
39
+ ## Example
40
+
41
+ require 'mina/ridgepole'
42
+
43
+ ...
44
+
45
+ task :deploy do
46
+ deploy do
47
+ invoke :'git:clone'
48
+ invoke :'deploy:link_shared_paths'
49
+ invoke :'bundle:install'
50
+ invoke :'ridgepole:apply'
51
+ ...
52
+
53
+ end
54
+ end
55
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,49 @@
1
+ require 'mina/bundler'
2
+ require 'mina/rails'
3
+
4
+ namespace :ridgepole do
5
+ set_default :ridgepole_env, -> { fetch(:rails_env, 'production') }
6
+ set_default :ridgepole_config, -> { "#{deploy_to}/#{shared_path}/config/database.yml" }
7
+ set_default :ridgepole_schemafile,-> { "Schemafile" }
8
+ set_default :ridgepole_options, -> { "" }
9
+ set_default :ridgepole_cmd, -> { "#{bundle_prefix} ridgepole" }
10
+
11
+ desc 'apply ridgepole'
12
+ task :apply => :environment do
13
+ options ||= ridgepole_options.kind_of?(Array) ? ridgepole_options.join(' ') : ridgepole_options.to_s
14
+ queue! %[
15
+ echo "-----> Applying schema."
16
+ if [ -f '#{deploy_to}/#{lock_file}' ]; then
17
+ #{ridgepole_cmd} -E #{ridgepole_env} --config #{ridgepole_config} --file #{ridgepole_schemafile} --apply #{options}
18
+ else
19
+ cd #{deploy_to}/#{current_path} && #{ridgepole_cmd} -E #{ridgepole_env} --config #{ridgepole_config} --file #{ridgepole_schemafile} --apply #{options}
20
+ fi
21
+ ]
22
+ end
23
+
24
+ desc 'apply dry-run ridgepole'
25
+ task :apply_dryrun => :environment do
26
+ options ||= ridgepole_options.kind_of?(Array) ? ridgepole_options.join(' ') : ridgepole_options.to_s
27
+ queue! %[
28
+ echo "-----> Applying schema.(dry-run)"
29
+ if [ -f '#{deploy_to}/#{lock_file}' ]; then
30
+ #{ridgepole_cmd} -E #{ridgepole_env} --config #{ridgepole_config} --file #{ridgepole_schemafile} --apply --dry-run #{options}
31
+ else
32
+ cd #{deploy_to}/#{current_path} && #{ridgepole_cmd} -E #{ridgepole_env} --config #{ridgepole_config} --file #{ridgepole_schemafile} --apply --dry-run #{options}
33
+ fi
34
+ ]
35
+ end
36
+
37
+ desc 'export ridgepole'
38
+ task :export => :environment do
39
+ options ||= ridgepole_options.kind_of?(Array) ? ridgepole_options.join(' ') : ridgepole_options.to_s
40
+ queue! %[
41
+ echo "-----> Export Schema from database."
42
+ if [ -f '#{deploy_to}/#{lock_file}' ]; then
43
+ #{ridgepole_cmd} -E #{ridgepole_env} --config #{ridgepole_config} --export #{options}
44
+ else
45
+ cd #{deploy_to}/#{current_path} && #{ridgepole_cmd} -E #{ridgepole_env} --config #{ridgepole_config} --export #{options}
46
+ fi
47
+ ]
48
+ end
49
+ end
@@ -0,0 +1,5 @@
1
+ module Mina
2
+ module Ridgepole
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ load File.expand_path("../ridgepole/tasks.rake", __FILE__)
2
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'mina/ridgepole/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'mina-ridgepole'
8
+ spec.version = Mina::Ridgepole::VERSION
9
+ spec.authors = ['Isao Sugimoto']
10
+ spec.email = ['d6rkaiz@gmail.com']
11
+ spec.description = %q{Ridgepole tasks for Mina}
12
+ spec.summary = %q{Ridgepole tasks for Mina}
13
+ spec.homepage = 'http://d6rkaiz.com'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'mina'
22
+ spec.add_dependency 'ridgepole', '~> 0.4.10'
23
+ spec.add_development_dependency 'bundler'
24
+ spec.add_development_dependency 'rake'
25
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mina-ridgepole
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Isao Sugimoto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mina
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ridgepole
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.10
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.4.10
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Ridgepole tasks for Mina
70
+ email:
71
+ - d6rkaiz@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - lib/mina/ridgepole.rb
82
+ - lib/mina/ridgepole/tasks.rake
83
+ - lib/mina/ridgepole/version.rb
84
+ - mina-ridgepole.gemspec
85
+ homepage: http://d6rkaiz.com
86
+ licenses:
87
+ - MIT
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.4.2
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: Ridgepole tasks for Mina
109
+ test_files: []