Skip to content

Commit

Permalink
Fix chefspec, drop version constraint on nginx and bump to 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanTron committed Jul 11, 2014
1 parent 8d98cce commit 8f5688a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This file is used to list changes made in each version of grafana.

## 1.2.0:

__breaking changes__

* Update `ark` dependency to `>= 0.7.2` and deprecation warning by using `strip_component` (Grégoire Seux) [#15](https://github.com/JonathanTron/chef-grafana/pull/14)

__minor changes__

* Support newer `nginx` cookbook by specifying `template: false` when enabling the `grafana` site (Grégoire Seux) [#15](https://github.com/JonathanTron/chef-grafana/pull/14)

## 1.1.1:

* Update default attributes to install Grafana 1.6.1 (Greg Fitzgerald) [#14](https://github.com/JonathanTron/chef-grafana/pull/14)
Expand Down
4 changes: 2 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
license 'Apache 2.0'
description 'Installs/Configures grafana'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.1.1'
version '1.2.0'

depends 'git'
depends 'ark', '>= 0.7.2'
depends 'nginx', '>= 2.5.0'
depends 'nginx'

supports 'ubuntu'
supports 'debian'
2 changes: 1 addition & 1 deletion recipes/_install_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
path node['grafana']['install_path']
checksum node['grafana']['file']['checksum']
owner grafana_user
strip_components (node['grafana']['file']['version'] > '1.5.1' ? 1 : 0)
strip_components(node['grafana']['file']['version'] > '1.5.1' ? 1 : 0)
action :put
end
20 changes: 19 additions & 1 deletion spec/install_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,26 @@ def put_ark(resource_name)
path: chef_run.node['grafana']['install_path'],
checksum: chef_run.node['grafana']['file']['checksum'],
owner: chef_run.node['nginx']['user'],
strip_leading_dir: true
strip_components: 1
)
end

context 'with grafana version older than 1.5.1' do
let(:chef_run) do
ChefSpec::Runner.new do |runner|
runner.node.set['grafana']['file']['version'] = '1.5.0'
end.converge described_recipe
end

it 'install grafana from remote url using ark' do
expect(chef_run).to put_ark('grafana').with(
url: chef_run.node['grafana']['file']['url'],
path: chef_run.node['grafana']['install_path'],
checksum: chef_run.node['grafana']['file']['checksum'],
owner: chef_run.node['nginx']['user'],
strip_components: 0
)
end
end

end

0 comments on commit 8f5688a

Please sign in to comment.