-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.2.0: Add support for changing the directory we look at for sites files
* Write nginx configuration instead of using nginx.conf from the deb * Allow sites directory to be set via `node.nginx_passenger.sites_dir` * Add initial serverspec tests
- Loading branch information
Eric Richardson
committed
Jan 24, 2014
1 parent
66be8b7
commit 8536968
Showing
12 changed files
with
287 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.kitchen/ | ||
.kitchen.local.yml | ||
.bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"path": "." | ||
}, | ||
"apt": { | ||
"locked_version": "2.1.0" | ||
"locked_version": "2.1.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'berkshelf' | ||
gem 'test-kitchen', '>= 1.1.1', :group => :integration | ||
gem 'kitchen-vagrant', :group => :integration | ||
gem 'serverspec' | ||
gem 'busser-serverspec' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
activesupport (3.2.16) | ||
i18n (~> 0.6, >= 0.6.4) | ||
multi_json (~> 1.0) | ||
addressable (2.3.5) | ||
akami (1.2.0) | ||
gyoku (>= 0.4.0) | ||
nokogiri (>= 1.4.0) | ||
berkshelf (2.0.13) | ||
activesupport (~> 3.2.0) | ||
addressable (~> 2.3.4) | ||
buff-shell_out (~> 0.1) | ||
chozo (>= 0.6.1) | ||
faraday (~> 0.8.0) | ||
faraday (~> 0.8.5) | ||
hashie (>= 2.0.2) | ||
minitar (~> 0.5.4) | ||
rbzip2 (~> 0.2.0) | ||
retryable (~> 1.3.3) | ||
ridley (~> 1.5.0) | ||
solve (>= 0.5.0) | ||
thor (~> 0.18.0) | ||
buff-config (0.4.0) | ||
buff-extensions (~> 0.3) | ||
varia_model (~> 0.1) | ||
buff-extensions (0.5.0) | ||
buff-ignore (1.1.1) | ||
buff-ruby_engine (0.1.0) | ||
buff-shell_out (0.1.1) | ||
buff-ruby_engine (~> 0.1.0) | ||
builder (3.2.2) | ||
busser (0.6.0) | ||
thor | ||
busser-serverspec (0.2.5) | ||
busser | ||
celluloid (0.14.1) | ||
timers (>= 1.0.0) | ||
celluloid-io (0.14.1) | ||
celluloid (>= 0.14.1) | ||
nio4r (>= 0.4.5) | ||
chozo (0.6.1) | ||
activesupport (>= 3.2.0) | ||
hashie (>= 2.0.2) | ||
multi_json (>= 1.3.0) | ||
diff-lcs (1.2.5) | ||
erubis (2.7.0) | ||
faraday (0.8.9) | ||
multipart-post (~> 1.2.0) | ||
ffi (1.9.3) | ||
gssapi (1.0.3) | ||
ffi (>= 1.0.1) | ||
gyoku (1.1.1) | ||
builder (>= 2.1.2) | ||
hashie (2.0.5) | ||
highline (1.6.20) | ||
hitimes (1.2.1) | ||
httpclient (2.3.4.1) | ||
httpi (0.9.7) | ||
rack | ||
i18n (0.6.9) | ||
json (1.8.1) | ||
kitchen-vagrant (0.14.0) | ||
test-kitchen (~> 1.0) | ||
little-plugger (1.1.3) | ||
logging (1.8.1) | ||
little-plugger (>= 1.1.3) | ||
multi_json (>= 1.3.6) | ||
mini_portile (0.5.2) | ||
minitar (0.5.4) | ||
mixlib-authentication (1.3.0) | ||
mixlib-log | ||
mixlib-log (1.6.0) | ||
mixlib-shellout (1.3.0) | ||
multi_json (1.8.4) | ||
multipart-post (1.2.0) | ||
net-http-persistent (2.9.1) | ||
net-scp (1.1.2) | ||
net-ssh (>= 2.6.5) | ||
net-ssh (2.7.0) | ||
nio4r (1.0.0) | ||
nokogiri (1.6.1) | ||
mini_portile (~> 0.5.0) | ||
nori (1.1.5) | ||
rack (1.5.2) | ||
rbzip2 (0.2.0) | ||
retryable (1.3.4) | ||
ridley (1.5.3) | ||
addressable | ||
buff-config (~> 0.2) | ||
buff-extensions (~> 0.3) | ||
buff-ignore (~> 1.1) | ||
buff-shell_out (~> 0.1) | ||
celluloid (~> 0.14.0) | ||
celluloid-io (~> 0.14.0) | ||
erubis | ||
faraday (>= 0.8.4) | ||
hashie (>= 2.0.2) | ||
json (>= 1.7.7) | ||
mixlib-authentication (>= 1.3.0) | ||
net-http-persistent (>= 2.8) | ||
net-ssh | ||
nio4r (>= 0.5.0) | ||
retryable | ||
solve (>= 0.4.4) | ||
varia_model (~> 0.1) | ||
winrm (~> 1.1.0) | ||
rspec (2.14.1) | ||
rspec-core (~> 2.14.0) | ||
rspec-expectations (~> 2.14.0) | ||
rspec-mocks (~> 2.14.0) | ||
rspec-core (2.14.7) | ||
rspec-expectations (2.14.4) | ||
diff-lcs (>= 1.1.3, < 2.0) | ||
rspec-mocks (2.14.4) | ||
rubyntlm (0.1.1) | ||
safe_yaml (0.9.7) | ||
savon (0.9.5) | ||
akami (~> 1.0) | ||
builder (>= 2.1.2) | ||
gyoku (>= 0.4.0) | ||
httpi (~> 0.9) | ||
nokogiri (>= 1.4.0) | ||
nori (~> 1.0) | ||
wasabi (~> 1.0) | ||
serverspec (0.14.4) | ||
highline | ||
net-ssh | ||
rspec (>= 2.13.0) | ||
specinfra (>= 0.1.0) | ||
solve (0.8.2) | ||
specinfra (0.4.1) | ||
test-kitchen (1.1.1) | ||
mixlib-shellout (~> 1.2) | ||
net-scp (~> 1.1) | ||
net-ssh (~> 2.7) | ||
safe_yaml (~> 0.9) | ||
thor (~> 0.18) | ||
thor (0.18.1) | ||
timers (2.0.0) | ||
hitimes | ||
uuidtools (2.1.4) | ||
varia_model (0.3.2) | ||
buff-extensions (~> 0.2) | ||
hashie (>= 2.0.2) | ||
wasabi (1.0.0) | ||
nokogiri (>= 1.4.0) | ||
winrm (1.1.3) | ||
gssapi (~> 1.0.0) | ||
httpclient (~> 2.2, >= 2.2.0.2) | ||
logging (~> 1.6, >= 1.6.1) | ||
nokogiri (~> 1.5) | ||
rubyntlm (~> 0.1.1) | ||
savon (= 0.9.5) | ||
uuidtools (~> 2.1.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
berkshelf | ||
busser-serverspec | ||
kitchen-vagrant | ||
serverspec | ||
test-kitchen (>= 1.1.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# THIS FILE IS MANAGED BY CHEF's nginx_passenger COOKBOOK. | ||
|
||
user www-data; | ||
worker_processes <%= node.nginx_passenger.nginx_workers %>; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 768; | ||
# multi_accept on; | ||
} | ||
|
||
http { | ||
|
||
## | ||
# Basic Settings | ||
## | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
types_hash_max_size 2048; | ||
# server_tokens off; | ||
|
||
# server_names_hash_bucket_size 64; | ||
# server_name_in_redirect off; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
## | ||
# Logging Settings | ||
## | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
## | ||
# Gzip Settings | ||
## | ||
|
||
gzip on; | ||
gzip_disable "msie6"; | ||
|
||
# gzip_vary on; | ||
# gzip_proxied any; | ||
# gzip_comp_level 6; | ||
# gzip_buffers 16 8k; | ||
# gzip_http_version 1.1; | ||
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
## | ||
# nginx-naxsi config | ||
## | ||
# Uncomment it if you installed nginx-naxsi | ||
## | ||
|
||
# include /etc/nginx/naxsi_core.rules; | ||
|
||
## | ||
# Virtual Host Configs | ||
## | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
include <%= node.nginx_passenger.sites_dir %>/*; | ||
} |
13 changes: 13 additions & 0 deletions
13
test/integration/default/serverspec/localhost/nginx_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "spec_helper" | ||
|
||
# nginx should be running | ||
describe service("nginx") do | ||
it { should be_running } | ||
end | ||
|
||
# nginx config should point to the sites dir | ||
describe file("/etc/nginx/nginx.conf") do | ||
it { should be_file } | ||
its(:content) { should include("include /etc/nginx/sites/*;") } | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'serverspec' | ||
|
||
include SpecInfra::Helper::Exec | ||
include SpecInfra::Helper::DetectOS | ||
|
||
RSpec.configure do |c| | ||
if ENV['ASK_SUDO_PASSWORD'] | ||
require 'highline/import' | ||
c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } | ||
else | ||
c.sudo_password = ENV['SUDO_PASSWORD'] | ||
end | ||
end |