mina-multistage 0.1.1 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d839fbb64df8b6fe56afba18db9d528cd51f0b8
4
- data.tar.gz: 3ed4553a9ebfddcaf9aa45347d6798803d375833
3
+ metadata.gz: 8980adf43c9d6808c017527a35559999b022fc0c
4
+ data.tar.gz: 8748a2af82cf2b6468ab387777a340a90ba6ab10
5
5
  SHA512:
6
- metadata.gz: b4bf358b8bf87398db95dbe0b22d28dd72664a968aac6715e9afabaa8576addbb3ddb74eac84ecff75b88b2fda0c9a3155d2251a27a23f94b8758697902e27e9
7
- data.tar.gz: 7b0e4ef4b9041c83188fc6ac29576616a12a25765ad6d898f2b0787a79145226e5e3699e593a9a33a14e6d4d336ce03d45c8a0f905151cdd37a7eceeae623f14
6
+ metadata.gz: dfcc430b2f564ecc9229d27dbee71a89f0d77ccc3529812a3fc0b3e86699a29e2798783d60b50b3cbf7513ed512add357547b8c9106d57b35701f48c5b68fe35
7
+ data.tar.gz: 520e50d0819fc8c7ae7edd2085e706e75057955e91692e66cdf142c1c35ddeb967743f44d20285cbbd132db0774797e1309a3cceed02ad0b770ae7057c2c1716
data/README.md CHANGED
@@ -26,7 +26,7 @@ Or install it yourself as:
26
26
  $ gem install mina-multistage
27
27
  ```
28
28
 
29
- Require `mina/multistage` in `config/deploy.rb`:
29
+ Require `mina/multistage` in your `config/deploy.rb`:
30
30
 
31
31
  ```rb
32
32
  require 'mina/multistage'
@@ -49,11 +49,20 @@ end
49
49
  Then run:
50
50
 
51
51
  ```shell
52
- $ mina multistage:init
52
+ $ bundle exec mina multistage:init
53
53
  ```
54
54
 
55
- It will create `config/deploy/staging.rb` and `config/deploy/production.rb` stage files.
56
- Use them to define stage-specific configuration.
55
+ This will create `config/deploy/staging.rb` and `config/deploy/production.rb` stage files.
56
+ Use them to define stage specific configuration.
57
+
58
+ If you receive the following error, make sure that you've required 'mina/multistage' in
59
+ your `config/deploy.rb`
60
+
61
+ ```shell
62
+ $ bundle exec mina multistage:init
63
+ mina aborted!
64
+ Don't know how to build task 'multistage:init'
65
+ ```
57
66
 
58
67
  ```rb
59
68
  # config/deploy/staging.rb
@@ -65,10 +74,10 @@ set :user, 'www'
65
74
  set :rails_env, 'staging'
66
75
  ```
67
76
 
68
- Now deploy `staging` with:
77
+ Now you can deploy the default stage with:
69
78
 
70
79
  ```shell
71
- $ mina deploy
80
+ $ mina deploy # this deploys staging by default
72
81
  ```
73
82
 
74
83
  Or specify a stage explicitly:
@@ -81,11 +90,36 @@ $ mina production deploy
81
90
 
82
91
  ## Configuration
83
92
 
84
- * `stages` - array of stages names, default is names of all `*.rb` files from `stages_dir`
85
- * `stages_dir` - stages files directory, default is `config/deploy`
86
- * `default_stage` - default stage, default is `staging`
93
+ * `stages` - array of stages names, the default is the name of all `*.rb` files from `stages_dir`
94
+ * `stages_dir` - stages files directory, the default is `config/deploy`
95
+ * `default_stage` - default stage, the default is `staging`
96
+
97
+ If you want to override the default values for any of these options, they should be set before requiring `mina/multistage`.
98
+
99
+ ```rb
100
+ # config/deploy.rb
101
+
102
+ set stages, %w(development test staging production)
103
+ set stages_dir, 'config/deploy_stages'
104
+ set default_stage, 'development'
105
+
106
+ require 'mina/multistage'
107
+ require 'mina/bundler'
108
+ require 'mina/rails'
109
+ require 'mina/git'
110
+
111
+ ...
112
+
113
+ task setup: :environment do
114
+ ...
115
+ end
116
+
117
+ desc 'Deploys the current version to the server.'
118
+ task deploy: :environment do
119
+ ...
120
+ end
121
+ ```
87
122
 
88
- If you want to override default values of these options, they should be set before requiring `mina/multistage` file.
89
123
 
90
124
  ## Contributing
91
125
 
@@ -3,6 +3,10 @@ def _default_stage
3
3
  fetch(:default_stage, 'staging')
4
4
  end
5
5
 
6
+ def _default_stages
7
+ fetch(:stages, %w(staging production))
8
+ end
9
+
6
10
  def _stages_dir
7
11
  fetch(:stages_dir, 'config/deploy')
8
12
  end
@@ -16,7 +20,7 @@ def _file_for_stage(stage_name)
16
20
  end
17
21
 
18
22
  def _stage_file_exists?(stage_name)
19
- File.exists?(_file_for_stage(stage_name))
23
+ File.exists?(File.expand_path(_file_for_stage(stage_name)))
20
24
  end
21
25
 
22
26
  def _get_all_stages
@@ -41,12 +45,13 @@ end
41
45
  invoke _default_stage if _stage_file_exists?(_default_stage) && !_argument_included_in_stages?(ARGV.first)
42
46
 
43
47
  namespace :multistage do
44
- desc 'Create staging and production stage files'
48
+ desc 'Create stage files'
45
49
  task :init do
46
50
  FileUtils.mkdir_p _stages_dir if !File.exists? _stages_dir
47
- %w{staging production}.each do |stage|
51
+ _default_stages.each do |stage|
48
52
  stagefile = _file_for_stage(stage)
49
- if !_stage_file_exists?(stagefile)
53
+ if !_stage_file_exists?(stage)
54
+ puts "Creating #{stagefile}"
50
55
  File.open(stagefile, 'w') do |f|
51
56
  f.puts "set :domain, ''"
52
57
  f.puts "set :deploy_to, ''"
@@ -54,6 +59,8 @@ namespace :multistage do
54
59
  f.puts "set :branch, ''"
55
60
  f.puts "set :user, ''"
56
61
  end
62
+ else
63
+ puts "Skipping #{stagefile}, it already exists"
57
64
  end
58
65
  end
59
66
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Multistage
3
- VERSION = "0.1.1"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["Chris@WideEyeLabs.com"]
11
11
  spec.description = %q{Adds multistage capabilities to Mina}
12
12
  spec.summary = %q{Adds multistage capabilities to Mina}
13
- spec.homepage = ""
13
+ spec.homepage = "http://endoze.github.io/mina-multistage/"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-multistage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-04 00:00:00.000000000 Z
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: mina
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
- - - '>='
17
+ - - ">="
17
18
  - !ruby/object:Gem::Version
18
19
  version: 0.2.1
20
+ type: :runtime
19
21
  prerelease: false
20
- name: mina
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
- - - '>='
24
+ - - ">="
24
25
  - !ruby/object:Gem::Version
25
26
  version: 0.2.1
26
- type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
+ name: bundler
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - '>='
31
+ - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: 1.3.5
34
+ type: :development
33
35
  prerelease: false
34
- name: bundler
35
36
  version_requirements: !ruby/object:Gem::Requirement
36
37
  requirements:
37
- - - '>='
38
+ - - ">="
38
39
  - !ruby/object:Gem::Version
39
40
  version: 1.3.5
40
- type: :development
41
41
  - !ruby/object:Gem::Dependency
42
+ name: rake
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
- - - '>='
45
+ - - ">="
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
48
+ type: :development
47
49
  prerelease: false
48
- name: rake
49
50
  version_requirements: !ruby/object:Gem::Requirement
50
51
  requirements:
51
- - - '>='
52
+ - - ">="
52
53
  - !ruby/object:Gem::Version
53
54
  version: '0'
54
- type: :development
55
55
  description: Adds multistage capabilities to Mina
56
56
  email:
57
57
  - Chris@WideEyeLabs.com
@@ -59,7 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
62
+ - ".gitignore"
63
63
  - Gemfile
64
64
  - LICENSE.txt
65
65
  - README.md
@@ -67,7 +67,7 @@ files:
67
67
  - lib/mina/multistage.rb
68
68
  - lib/mina/multistage/version.rb
69
69
  - mina_multistage.gemspec
70
- homepage: ''
70
+ homepage: http://endoze.github.io/mina-multistage/
71
71
  licenses:
72
72
  - MIT
73
73
  metadata: {}
@@ -77,17 +77,17 @@ require_paths:
77
77
  - lib
78
78
  required_ruby_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.2.2
90
+ rubygems_version: 2.4.5
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Adds multistage capabilities to Mina