Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Commit

Permalink
fix realityforge#68; add tests for ubuntu 12.04 & 14.04
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberflow committed Apr 29, 2016
1 parent b1aca7a commit 84ec242
Show file tree
Hide file tree
Showing 20 changed files with 153 additions and 143 deletions.
29 changes: 6 additions & 23 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,34 @@ platforms:
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box
run_list:
- recipe[apt]
- name: ubuntu-14.04
run_list:
- recipe[apt]
- name: centos-6.4
driver_config:
box: opscode-centos-6.4
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box

suites:
- name: default
run_list:
- 'recipe[kibana]'
attributes: {}
- name: kibana3
- name: kibana3_apache
run_list:
- 'recipe[kibana]'
- 'recipe[apache2]'
- 'recipe[kibana::apache]'
attributes:
kibana:
version: '3'
nginx:
listen_http: 8080
attributes: {}
- name: kibana3_nginx
run_list:
- 'recipe[kibana]'
- 'recipe[nginx]'
- 'recipe[kibana::nginx]'
attributes:
kibana:
version: '3'
attributes: {}
- name: kibana3_source
run_list:
- 'recipe[kibana]'
- 'recipe[apache2]'
- 'recipe[kibana::apache]'
attributes:
kibana:
version: '3'
nginx:
listen_http: 8080
install_method: 'source'
- name: kibana4
run_list:
Expand Down Expand Up @@ -78,10 +68,3 @@ suites:
version: '4'
nginx:
listen_http: 8080
- name: kibana4_source
run_list:
- 'recipe[kibana]'
attributes:
kibana:
version: '4'
install_method: 'source'
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ env:
matrix:
- TESTS="rubocop"
- TESTS="foodcritic"
- TESTS="integration:docker[default-ubuntu-1204]"
- TESTS="integration:docker[kibana3-apache-ubuntu-1204]"
- TESTS="integration:docker[kibana3-nginx-ubuntu-1204]"
- TESTS="integration:docker[kibana3-source-ubuntu-1204]"
- TESTS="integration:docker[kibana4-ubuntu-1204]"
- TESTS="integration:docker[kibana4-nginx-ubuntu-1204]"
- TESTS="integration:docker[kibana3-apache-ubuntu-1404]"
- TESTS="integration:docker[kibana3-nginx-ubuntu-1404]"
- TESTS="integration:docker[kibana3-source-ubuntu-1404]"
- TESTS="integration:docker[kibana4-ubuntu-1404]"
- TESTS="integration:docker[kibana4-nginx-ubuntu-1404]"


matrix:
exclude:
Expand Down
2 changes: 1 addition & 1 deletion Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata

group :vagrant do
cookbook 'apt'
cookbook 'apache2'
cookbook 'apache2', '= 3.1'
cookbook 'nginx'
cookbook 'java'
cookbook 'elasticsearch'
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v.0.1.11:
* removed support for kibana2 ( use 0.1.10 releases )
* added serverspec tests

## v0.1.10:
* Support proxying elasticsearch through apache. Submitted by Dmitry (cyberflow).
* Replace depends with suggest for the apache cookbook as it is not needed when using nginx. Submitted by Bryan Casey.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'berkshelf', '~> 4.0'
gem 'berkshelf'

group :test do
gem 'rake', '~> 10.1.0'
Expand Down
16 changes: 5 additions & 11 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Encoding: utf-8

#<> Kibana major version
default['kibana']['version'] = '2'
default['kibana']['version'] = '3'
#<> Kibana3 exact version
default['kibana']['kibana3_version'] = '3.0.0'
#<> Kibana4 exact version
Expand All @@ -24,17 +24,11 @@
default['kibana']['kibana4_checksum'] = '67d586e43a35652adeb6780eaa785d3d785ce60cc74fbf3b6a9a53b753c8f985'

#<> The URL to Kibana repository.
default['kibana']['git']['url'] = if node['kibana']['version'] > '2'
'https://github.com/elasticsearch/kibana.git'
else
'https://github.com/rashidkpc/kibana2.git'
end
default['kibana']['git']['url'] = 'https://github.com/elasticsearch/kibana.git'

#<> The git reference in the Kibana repository.
default['kibana']['git']['reference'] = if node['kibana']['version'] > '2'
'v' + node['kibana']['kibana3_version']
else
'v0.2.0'
end
default['kibana']['git']['reference'] = 'v' + node['kibana']['kibana3_version']

#<> The version of Ruby and Gems to use for Kibana.
case node['platform_family']
when 'debian'
Expand Down
8 changes: 7 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
license 'Apache 2.0'
description 'Installs/Configures kibana, the logstash UI'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.10'
version '0.1.11'

supports 'ubuntu'
supports 'debian'

depends 'build-essential'
depends 'ark'

suggests 'apache2', '>= 2.0'
suggests 'authbind'
suggests 'apt'
suggests 'nginx'
suggests 'java'
suggests 'elasticsearch'

conflicts 'apache2', '>= 3.2'
1 change: 0 additions & 1 deletion recipes/apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
'kibana_service' => node['kibana']['kibana_service'],
'port' => node['kibana']['elasticsearch']['port']
)
source 'vhost.conf.erb' if node['kibana']['version'] =~ /^2/
source 'vhost3.conf.erb' if node['kibana']['version'] =~ /^3/
source 'vhost4.conf.erb' if node['kibana']['version'] =~ /^4/
cookbook node['kibana']['apache']['cookbook']
Expand Down
67 changes: 0 additions & 67 deletions recipes/kibana2.rb

This file was deleted.

37 changes: 0 additions & 37 deletions templates/default/vhost.conf.erb

This file was deleted.

18 changes: 18 additions & 0 deletions test/integration/kibana3_apache/serverspec/deafult_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Encoding: utf-8
require 'spec_helper'

describe 'kibana' do
describe file('/opt/kibana') do
it { should be_directory }
end
end

describe 'apache' do
describe port(80) do
it { should be_listening }
end
describe service('apache2') do
it { should be_enabled }
it { should be_running }
end
end
5 changes: 5 additions & 0 deletions test/integration/kibana3_apache/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Encoding: utf-8
require 'serverspec'

# Required by serverspec
set :backend, :exec
18 changes: 18 additions & 0 deletions test/integration/kibana3_nginx/serverspec/deafult_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Encoding: utf-8
require 'spec_helper'

describe 'kibana' do
describe file('/opt/kibana') do
it { should be_directory }
end
end

describe 'nginx' do
describe port(80) do
it { should be_listening }
end
describe service('nginx') do
it { should be_enabled }
it { should be_running }
end
end
5 changes: 5 additions & 0 deletions test/integration/kibana3_nginx/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Encoding: utf-8
require 'serverspec'

# Required by serverspec
set :backend, :exec
8 changes: 8 additions & 0 deletions test/integration/kibana3_source/serverspec/deafult_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Encoding: utf-8
require 'spec_helper'

describe 'kibana' do
describe file('/opt/kibana') do
it { should be_directory }
end
end
5 changes: 5 additions & 0 deletions test/integration/kibana3_source/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Encoding: utf-8
require 'serverspec'

# Required by serverspec
set :backend, :exec
25 changes: 25 additions & 0 deletions test/integration/kibana4/serverspec/deafult_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Encoding: utf-8
require 'spec_helper'

describe 'kibana' do
describe file('/opt/kibana') do
it { should be_directory }
end
describe service('kibana') do
it { should be_enabled }
it { should be_running }
end
describe port(5601) do
it { should be_listening }
end
end

describe 'apache' do
describe port(8080) do
it { should be_listening }
end
describe service('apache2') do
it { should be_enabled }
it { should be_running }
end
end
5 changes: 5 additions & 0 deletions test/integration/kibana4/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Encoding: utf-8
require 'serverspec'

# Required by serverspec
set :backend, :exec
Loading

0 comments on commit 84ec242

Please sign in to comment.