mina-multistage 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mina_multistage.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Chris Stephan
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,93 @@
1
+ # Mina::Multistage
2
+
3
+ Plugin for Mina that adds support for multiple stages.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```rb
10
+ gem 'mina-multistage', required: false
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```shell
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```shell
22
+ $ gem install mina-multistage
23
+ ```
24
+
25
+ And finally add this line to your config/deploy.rb:
26
+
27
+ ```rb
28
+ require 'mina/multistage'
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ A sample config/deploy.rb could look something like this:
34
+
35
+
36
+ ```rb
37
+ require 'mina/bundler'
38
+ require 'mina/rails'
39
+ require 'mina/git'
40
+ require 'mina/rvm'
41
+ require 'mina/multistage'
42
+
43
+ set :shared_paths, ['config/database.yml', 'log', 'tmp/sockets', 'pid/pids']
44
+
45
+ task :setup => :environment do
46
+ queue! %[mkdir -p "#{deploy_to}/shared/log"]
47
+ queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]
48
+
49
+ queue! %[mkdir -p "#{deploy_to}/shared/config"]
50
+ queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]
51
+
52
+ queue! %[mkdir -p "#{deploy_to}/shared/tmp/sockets"]
53
+ queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/tmp/sockets"]
54
+
55
+ queue! %[mkdir -p "#{deploy_to}/shared/pid/pids"]
56
+ queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/pid/pids"]
57
+
58
+ queue! %[touch "#{deploy_to}/shared/config/database.yml"]
59
+ queue %[#-----> Be sure to edit 'shared/config/database.yml'.]
60
+ end
61
+
62
+ desc "Deploys the current version to the server."
63
+ task :deploy => :environment do
64
+ deploy do
65
+ invoke :'git:clone'
66
+ invoke :'deploy:link_shared_paths'
67
+ invoke :'bundle:install'
68
+ invoke :'rails:db_migrate'
69
+ invoke :'rails:assets_precompile'
70
+
71
+ to :launch do
72
+ queue "bundle exec thin restart -C #{deploy_to}/shared/config/thin.yml"
73
+ end
74
+ end
75
+ end
76
+ ```
77
+
78
+ And a sample development.rb stagefile:
79
+ ```rb
80
+ set :domain, 'localhost'
81
+ set :deploy_to, '/var/www/my_app'
82
+ set :repository, 'https://github.com/gitlabhq/gitlabhq'
83
+ set :branch, '6-1-stable'
84
+ set :user, 'deploy'
85
+ ```
86
+
87
+ ## Contributing
88
+
89
+ 1. Fork it
90
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
91
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
92
+ 4. Push to the branch (`git push origin my-new-feature`)
93
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,45 @@
1
+ require 'fileutils'
2
+
3
+ location = fetch(:stage_dir, "config/deploy")
4
+
5
+ unless exists?(:stages)
6
+ set :stages, Dir["#{location}/*.rb"].map { |f| File.basename(f, ".rb") }
7
+ end
8
+
9
+ stages.each do |name|
10
+ desc "Set the target stage to `#{name}'."
11
+ task(name) do
12
+ set :stage, name.to_sym
13
+
14
+ file = "#{location}/#{stage}.rb"
15
+ load file
16
+ end
17
+ end
18
+
19
+ if stages && stages.count > 0
20
+ if stages.include? 'development'
21
+ invoke :development
22
+ else
23
+ invoke stages.first
24
+ end
25
+ end
26
+
27
+ namespace :multistage do
28
+ desc "Create development, staging, and production stage files"
29
+ task :create_stagefiles do
30
+ Dir.mkdir location if !File.exists? location
31
+
32
+ %w{ development staging production }.each do |stage|
33
+ stagefile = File.join(location, "#{stage}.rb")
34
+ if !File.exists?(stagefile)
35
+ File.open(stagefile, 'w') do |f|
36
+ f.puts "set :domain, ''"
37
+ f.puts "set :deploy_to, ''"
38
+ f.puts "set :repository, ''"
39
+ f.puts "set :branch, ''"
40
+ f.puts "set :user, ''"
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,5 @@
1
+ module Mina
2
+ module Multistage
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -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
+ require 'mina/multistage/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mina-multistage"
8
+ spec.version = Mina::Multistage::VERSION
9
+ spec.authors = ["Chris"]
10
+ spec.email = ["Chris@WideEyeLabs.com"]
11
+ spec.description = %q{Adds multistage capabilities to Mina}
12
+ spec.summary = %q{Adds multistage capabilities to Mina}
13
+ spec.homepage = ""
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", ">= 0.2.1"
22
+ spec.add_development_dependency "bundler", ">= 1.3.5"
23
+ spec.add_development_dependency "rake"
24
+ end
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mina-multistage
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Chris
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-09-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: mina
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.2.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.2.1
30
+ - !ruby/object:Gem::Dependency
31
+ name: bundler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 1.3.5
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.3.5
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Adds multistage capabilities to Mina
63
+ email:
64
+ - Chris@WideEyeLabs.com
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - .gitignore
70
+ - Gemfile
71
+ - LICENSE.txt
72
+ - README.md
73
+ - Rakefile
74
+ - lib/mina/multistage.rb
75
+ - lib/mina/multistage/version.rb
76
+ - mina_multistage.gemspec
77
+ homepage: ''
78
+ licenses:
79
+ - MIT
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ segments:
91
+ - 0
92
+ hash: -3037949548670809400
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ segments:
100
+ - 0
101
+ hash: -3037949548670809400
102
+ requirements: []
103
+ rubyforge_project:
104
+ rubygems_version: 1.8.25
105
+ signing_key:
106
+ specification_version: 3
107
+ summary: Adds multistage capabilities to Mina
108
+ test_files: []