blue-nginx 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,21 @@
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
+ *.swp
19
+ *.swo
20
+ README.html
21
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in blue-nginx.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Josh Sharpe
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.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Blue::Nginx
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'blue-nginx'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install blue-nginx
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'blue/nginx/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "blue-nginx"
8
+ spec.version = Blue::Nginx::VERSION
9
+ spec.authors = ["Josh Sharpe"]
10
+ spec.email = ["josh.m.sharpe@gmail.com"]
11
+ spec.description = %q{A Nginx plugin for the Blue deployment framework}
12
+ spec.summary = %q{Adds configs, init scripts and monitoring for Nginx}
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_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
data/lib/blue/nginx.rb ADDED
@@ -0,0 +1,44 @@
1
+ require "blue/nginx/version"
2
+
3
+ module Blue
4
+ module Nginx
5
+
6
+ Blue.configure({
7
+ :nginx => {
8
+ :version => '1.5.1'
9
+ }
10
+ })
11
+
12
+ Blue::Gems.require('blue-nginx')
13
+
14
+ def nginx
15
+ file "/etc/apt/sources.list.d/nginx.list",
16
+ :ensure => :present,
17
+ :content => "deb http://nginx.org/packages/ubuntu/ precise nginx"
18
+ exec 'get gpg key',
19
+ :command => "wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -",
20
+ :require => file("/etc/apt/sources.list.d/nginx.list"),
21
+ :unless => "test -x /usr/sbin/nginx"
22
+ exec 'apt-get update',
23
+ :command => 'apt-get update',
24
+ :require => exec("get gpg key"),
25
+ :unless => "test -x /usr/sbin/nginx"
26
+ packages = ["nginx"]
27
+ packages.each do |pkg|
28
+ package pkg,
29
+ :ensure => :installed,
30
+ :require => exec("apt-get update")
31
+ end
32
+ file "/etc/nginx/nginx.conf",
33
+ :ensure => :present,
34
+ :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'nginx.conf.erb'), binding)
35
+ end
36
+
37
+ def self.included(klass)
38
+ klass.class_eval do
39
+ recipe :nginx
40
+ end
41
+ end
42
+ end
43
+ end
44
+
@@ -0,0 +1,5 @@
1
+ module Blue
2
+ module Nginx
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,27 @@
1
+
2
+ worker_processes 1;
3
+
4
+ user nobody nogroup;
5
+
6
+ pid <%= Blue.pids_path + 'nginx.pid' %>;
7
+ error_log <%= Blue.logs_path + 'nginx.error.log' %>;
8
+
9
+ events {
10
+ worker_connections 1024;
11
+ accept_mutex off;
12
+ }
13
+
14
+ http {
15
+ server {
16
+ listen 80;
17
+ server_name localhost;
18
+
19
+ location / {
20
+ root /tmp/nginx_test/;
21
+ }
22
+ }
23
+ }
24
+
25
+ include /etc/nginx/conf.d/*.conf;
26
+ include /etc/nginx/sites-enabled/*;
27
+
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blue-nginx
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Josh Sharpe
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2013-06-29 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: bundler
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 9
29
+ segments:
30
+ - 1
31
+ - 3
32
+ version: "1.3"
33
+ type: :development
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: rake
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :development
48
+ version_requirements: *id002
49
+ description: A Nginx plugin for the Blue deployment framework
50
+ email:
51
+ - josh.m.sharpe@gmail.com
52
+ executables: []
53
+
54
+ extensions: []
55
+
56
+ extra_rdoc_files: []
57
+
58
+ files:
59
+ - .gitignore
60
+ - Gemfile
61
+ - LICENSE.txt
62
+ - README.md
63
+ - Rakefile
64
+ - blue-nginx.gemspec
65
+ - lib/blue/nginx.rb
66
+ - lib/blue/nginx/version.rb
67
+ - templates/nginx.conf.erb
68
+ homepage: ""
69
+ licenses:
70
+ - MIT
71
+ post_install_message:
72
+ rdoc_options: []
73
+
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ hash: 3
82
+ segments:
83
+ - 0
84
+ version: "0"
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 0
93
+ version: "0"
94
+ requirements: []
95
+
96
+ rubyforge_project:
97
+ rubygems_version: 1.8.24
98
+ signing_key:
99
+ specification_version: 3
100
+ summary: Adds configs, init scripts and monitoring for Nginx
101
+ test_files: []
102
+