capistrano3-ridgepole 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0a975f5d5aa5a8f1e73c821f5f62f827522f1b78
4
+ data.tar.gz: 662b66a5acedc4ab62e6f4e3c65f4b7ef506b242
5
+ SHA512:
6
+ metadata.gz: 808784f618eab84cff93a49a0816e7ebf25dbcce2616299d499d3e19d26cc13a4d7c404ed5a55976f419cede443a97143388ea322929829414d9bc77066650c8
7
+ data.tar.gz: 9248ca0131fe2253cd844321359adda8b9f0e0dadc7065e64587978ca67d628965a0a0d0f773f47d30bd43da3218e24c85c75f0d2a2aabbd34eadbb6233db816
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano3-ridgepole.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2016 timakin
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.
@@ -0,0 +1,31 @@
1
+ # Capistrano3::Ridgepole
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'capistrano3-ridgepole'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install capistrano3-ridgepole
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/capistrano3-ridgepole/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,24 @@
1
+ # coding: 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 |spec|
6
+ spec.name = "capistrano3-ridgepole"
7
+ spec.version = "0.0.1"
8
+ spec.authors = ["timakin"]
9
+ spec.email = ["timaki.st@gmail.com"]
10
+ spec.summary = %q{Capistrano3 plugin for ridgepole schema application}
11
+ spec.description = %q{Capistrano3 plugin for ridgepole schema application. It can handle commands: "--apply", "--dry-run", "--diff", and the other additional options}
12
+ spec.homepage = "https://github.com/timakin/capistrano3-ridgepole"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "capistrano", "~> 3.4.0", '>= 3.4.0'
23
+ spec.add_development_dependency "ridgepole", "~> 0.6.4", '>= 0.6.4'
24
+ end
File without changes
@@ -0,0 +1 @@
1
+ load File.expand_path("../tasks/ridgepole.rake", __FILE__)
@@ -0,0 +1,55 @@
1
+ namespace :load do
2
+ task :defaults do
3
+ set :ridgepole_roles, -> { :db }
4
+ set :ridgepole_schema_file, -> { File.join(current_path, "Schemafile") }
5
+ set :ridgepole_config_file, -> { File.join(current_path, "config", "database.yml") }
6
+ set :ridgepole_env, -> { fetch(:rails_env) || "development" }
7
+ set :ridgepole_options, -> { "" }
8
+ set :overwrite_migration_tasks, -> { false }
9
+ end
10
+ end
11
+
12
+ namespace :ridgepole do
13
+ desc 'Apply Schemafile with ridgepole'
14
+ task :apply do
15
+ on roles(fetch(:ridgepole_roles)) do
16
+ within current_path do
17
+ execute :bundle, :exec, "#{ridgepole_base_command}"
18
+ end
19
+ end
20
+ end
21
+
22
+ desc 'Test Schemafile application with ridgepole dry-run'
23
+ task :dry_run do
24
+ on roles(fetch(:ridgepole_roles)) do
25
+ within current_path do
26
+ execute :bundle, :exec, "#{ridgepole_base_command} --dry-run"
27
+ end
28
+ end
29
+ end
30
+
31
+ desc 'Show difference that will be created by schema application'
32
+ task :diff do
33
+ on roles(fetch(:ridgepole_roles)) do
34
+ within current_path do
35
+ execute :bundle, :exec, "ridgepole --diff #{fetch(:ridgepole_config_file)} #{fetch(:ridgepole_schema_file)}"
36
+ end
37
+ end
38
+ end
39
+
40
+ def ridgepole_base_command
41
+ "ridgepole --apply --file #{fetch(:ridgepole_schema_file)} --config #{fetch(:ridgepole_config_file)} -E #{fetch(:ridgepole_env)} #{fetch(:ridgepole_options)}"
42
+ end
43
+ end
44
+
45
+ before "ridgepole:apply", "ridgepole:dry_run", "ridgepole:diff" do
46
+ if test "! [ -f #{fetch(:ridgepole_schema_file)} ]"
47
+ error "Schema file is not found. Default path to specify Schemafile is #{fetch(:ridgepole_schema_file)}"
48
+ exit 1
49
+ elsif test "! [ -f #{fetch(:ridgepole_config_file)} ]"
50
+ error "Config file is not found. Default path to specify database.yml configuration file is #{fetch(:ridgepole_config_file)}"
51
+ exit 1
52
+ else
53
+ logger.info "Loading Schemafile and database.yml for Ridgepole task"
54
+ end
55
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano3-ridgepole
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - timakin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: capistrano
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.4.0
48
+ - - '>='
49
+ - !ruby/object:Gem::Version
50
+ version: 3.4.0
51
+ type: :development
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: 3.4.0
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: 3.4.0
61
+ - !ruby/object:Gem::Dependency
62
+ name: ridgepole
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: 0.6.4
68
+ - - '>='
69
+ - !ruby/object:Gem::Version
70
+ version: 0.6.4
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.6.4
78
+ - - '>='
79
+ - !ruby/object:Gem::Version
80
+ version: 0.6.4
81
+ description: 'Capistrano3 plugin for ridgepole schema application. It can handle commands:
82
+ "--apply", "--dry-run", "--diff", and the other additional options'
83
+ email:
84
+ - timaki.st@gmail.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - .gitignore
90
+ - Gemfile
91
+ - LICENSE.txt
92
+ - README.md
93
+ - Rakefile
94
+ - capistrano3-ridgepole.gemspec
95
+ - lib/capistrano3-ridgepole.rb
96
+ - lib/capistrano3/ridgepole.rb
97
+ - lib/capistrano3/tasks/ridgepole.rake
98
+ homepage: https://github.com/timakin/capistrano3-ridgepole
99
+ licenses:
100
+ - MIT
101
+ metadata: {}
102
+ post_install_message:
103
+ rdoc_options: []
104
+ require_paths:
105
+ - lib
106
+ required_ruby_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - '>='
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ requirements: []
117
+ rubyforge_project:
118
+ rubygems_version: 2.4.8
119
+ signing_key:
120
+ specification_version: 4
121
+ summary: Capistrano3 plugin for ridgepole schema application
122
+ test_files: []
123
+ has_rdoc: