Commit 58fdf0a4 authored by Grégoire Pineau's avatar Grégoire Pineau

bug #3 Fix package updating (tucksaun)

This PR was merged into the master branch.

Discussion
----------

Fix package updating

Currently the cookbook forces the installation of the most recent version retrieved via the API.
However the local APT cache can be not up-to-date and so the package installation fails.

With this PR we are sure that the blackfire repository is always up-to-date before installing the package.

Commits
-------

ee164d4a Force Blackfire repositories update on run
6aa2ff2a Upgrade ruby version
parents a5a26e8a ee164d4a
sudo: false
language: ruby
rvm:
- 2.1.2
- 2.2.0
bundler_args: --without development --without kitchen_vagrant
cache: bundler
before_install:
......
source 'https://rubygems.org'
ruby '2.1.2'
ruby '2.2.0'
gem 'foodcritic'
gem 'rubocop'
......
......@@ -15,16 +15,25 @@ when 'rhel', 'fedora'
gpgcheck false
sslverify true
sslcacert '/etc/pki/tls/certs/ca-bundle.crt'
action :create
action [:create, :makecache]
only_if { node['blackfire']['install_repository'] }
end
else
apt_repository 'blackfire' do
r = apt_repository 'blackfire' do
uri "#{node[cookbook_name]['repository']}/#{node['platform']}"
distribution 'any'
key 'https://packagecloud.io/gpg.key'
components ['main']
action :add
action :nothing
only_if { node['blackfire']['install_repository'] }
end
r.run_action(:add)
unless r.updated?
execute 'blackfire repository update' do
command "apt-get update -o Dir::Etc::sourcelist='sources.list.d/#{r.name}.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'"
ignore_failure true
action :run
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment