diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e7f1ca2..c2a4fa26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/metadata.rb b/metadata.rb index b259dacf..0778f97e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -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' diff --git a/recipes/_install_file.rb b/recipes/_install_file.rb index 55409007..810282d2 100644 --- a/recipes/_install_file.rb +++ b/recipes/_install_file.rb @@ -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 diff --git a/spec/install_file_spec.rb b/spec/install_file_spec.rb index b41a85db..37cd55e8 100644 --- a/spec/install_file_spec.rb +++ b/spec/install_file_spec.rb @@ -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