Skip to content

Commit

Permalink
Merge pull request #11 from bkw/fixUiDir
Browse files Browse the repository at this point in the history
remove superfluous subdir consol_ui
  • Loading branch information
John Bellone committed Jun 6, 2014
2 parents 2ce1723 + eeaf1ff commit c2e5fcc
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ suites:
- name: default
run_list:
- recipe[consul::default]
- name: ui
run_list:
- recipe[consul::default]
- recipe[consul::ui]
attributes:
consul:
serve_ui: true
2 changes: 1 addition & 1 deletion recipes/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
end

if node[:consul][:serve_ui]
service_params = "#{service_params} -ui-dir #{node[:consul][:ui_dir]}/consul_ui -client #{node[:consul][:client_addr]}"
service_params = "#{service_params} -ui-dir #{node[:consul][:ui_dir]} -client #{node[:consul][:client_addr]}"
end

directory node[:consul][:config_dir]
Expand Down
1 change: 1 addition & 0 deletions recipes/ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
install_checksum = node[:consul][:checksums].fetch(install_version)

ark 'consul_ui' do
name ""
path node[:consul][:ui_dir]
version node[:consul][:version]
checksum install_checksum
Expand Down
11 changes: 11 additions & 0 deletions test/integration/ui/serverspec/localhost/consul_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'spec_helper'

describe file('/var/lib/consul/ui/index.html') do
it { should be_file }
end

describe command('wget -q -O- http://0.0.0.0:8500/ui/index.html') do
it { should return_exit_status 0 }
its(:stdout) { should == File.read('/var/lib/consul/ui/index.html') }
end

16 changes: 16 additions & 0 deletions test/integration/ui/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
begin
require 'rspec/its'
rescue LoadError
require 'rubygems/dependency_installer'
Gem::DependencyInstaller.new.install('rspec-its')
require 'rspec/its'
end

require 'serverspec'

include SpecInfra::Helper::Exec
include SpecInfra::Helper::DetectOS

RSpec.configure do |c|
c.path = '/usr/local/bin:/sbin:/bin:/usr/bin'
end

0 comments on commit c2e5fcc

Please sign in to comment.