mina-nginx 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/Rakefile +1 -1
- data/lib/mina/nginx.rb +19 -19
- data/lib/mina/nginx/version.rb +1 -1
- data/mina-nginx.gemspec +12 -12
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fc9f55e13f8c93e65915450dba5af5b713a835f
|
4
|
+
data.tar.gz: 3ceb413fd582ed68e31e3d50854f2a14f3ae6f5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 925707213e89e846e632c363ec2572cf53e25f2604019324a7de1a83499275fb1e5a5428edf7d8767bcd8d92c5094b91f2516b05ef87f210b906eb428f76f889
|
7
|
+
data.tar.gz: 0405cf368b7f6ade3a12667a6d0655b6d408585c7594dedc1814d93ac6fa9868dd51249a122fb5d6758fae864ecfb944b68672ee7791c301a49c3c5bb60025ba
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ Add this to your `config/deploy.rb` file:
|
|
34
34
|
|
35
35
|
require 'mina/nginx'
|
36
36
|
|
37
|
-
Make sure the following settings are
|
37
|
+
Make sure the following settings are set in your `config/deploy.rb`:
|
38
38
|
|
39
39
|
* `application` - application name
|
40
40
|
* `server_name` - your application's server_name in nginx (e.g. example.com)(optional)
|
@@ -47,10 +47,9 @@ $ mina nginx:setup
|
|
47
47
|
$ mina nginx:link
|
48
48
|
```
|
49
49
|
|
50
|
-
|
51
|
-
configuration file by `mina nginx:parse` on your server.
|
50
|
+
You can parse an sample configuration file by `mina nginx:parse` on your server.
|
52
51
|
|
53
|
-
|
52
|
+
Be sure to edit `shared/config/nginx.conf`, and then:
|
54
53
|
|
55
54
|
```
|
56
55
|
$ mina nginx:reload
|
@@ -58,7 +57,7 @@ $ mina nginx:reload
|
|
58
57
|
|
59
58
|
## Contributing
|
60
59
|
|
61
|
-
1. Fork it ( http://github.com
|
60
|
+
1. Fork it ( http://github.com/hbin/mina-nginx/fork )
|
62
61
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
63
62
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
64
63
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
data/lib/mina/nginx.rb
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
require
|
1
|
+
require 'mina/nginx/version'
|
2
2
|
|
3
3
|
namespace :nginx do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
set :nginx_user, 'www-data'
|
5
|
+
set :nginx_group, 'www-data'
|
6
|
+
set :nginx_path, '/etc/nginx'
|
7
|
+
set :nginx_config, -> { "#{fetch(:shared_path)}/config/nginx.conf" }
|
8
|
+
set :nginx_config_e, -> { "#{fetch(:nginx_path)}/sites-enabled/#{application}.conf" }
|
9
9
|
|
10
10
|
desc 'Setup Nginx'
|
11
11
|
task :setup => :environment do
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
command %(Setup the nginx)
|
13
|
+
command %(touch #{fetch(:nginx_config)})
|
14
|
+
comment %(Be sure to edit 'shared/config/nginx.conf'.)
|
15
15
|
end
|
16
16
|
|
17
17
|
desc 'Symlinking nginx config file'
|
18
18
|
task :link => :environment do
|
19
|
-
|
20
|
-
|
19
|
+
comment %(Symlinking nginx config file)
|
20
|
+
command %(sudo ln -nfs "#{fetch(:nginx_config)}" "#{fetch(:nginx_config_e)}")
|
21
21
|
end
|
22
22
|
|
23
23
|
desc 'Parse nginx configuration file and upload it to the server.'
|
24
24
|
task :parse => :environment do
|
25
25
|
content = erb(nginx_template)
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
command %(echo '#{content}' > #{fetch(:nginx_config)})
|
27
|
+
command %(cat #{fetch(:nginx_config)})
|
28
|
+
comment %(Be sure to edit 'shared/config/nginx.conf'.)
|
29
29
|
end
|
30
30
|
|
31
31
|
%w(stop start restart reload status).each do |action|
|
32
32
|
desc "#{action.capitalize} Nginx"
|
33
33
|
task action.to_sym => :environment do
|
34
|
-
|
35
|
-
|
34
|
+
comment %(#{action.capitalize} Nginx)
|
35
|
+
command "sudo service nginx #{action}"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
def nginx_template
|
42
|
+
File.expand_path('../templates/nginx.conf.erb', __FILE__)
|
43
|
+
end
|
44
44
|
end
|
data/lib/mina/nginx/version.rb
CHANGED
data/mina-nginx.gemspec
CHANGED
@@ -4,22 +4,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'mina/nginx/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'mina-nginx'
|
8
8
|
spec.version = Mina::Nginx::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary = %
|
12
|
-
spec.description = %
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
9
|
+
spec.authors = ['hbin']
|
10
|
+
spec.email = ['huangbin88@foxmail.com']
|
11
|
+
spec.summary = %(Mina tasks for handle with Nginx.)
|
12
|
+
spec.description = %(Configuration and managements Mina tasks for Nginx.)
|
13
|
+
spec.homepage = 'https://github.com/hbin/mina-nginx.git'
|
14
|
+
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split(
|
16
|
+
spec.files = `git ls-files`.split($RS)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
19
|
+
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency
|
21
|
+
spec.add_dependency 'mina', '~> 1'
|
22
22
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
24
|
+
spec.add_development_dependency 'rake', '~> 0'
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-nginx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hbin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mina
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Configuration and managements Mina tasks for Nginx.
|
@@ -88,9 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.5.1
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Mina tasks for handle with Nginx.
|
95
95
|
test_files: []
|
96
|
-
has_rdoc:
|