Skip to content

Commit

Permalink
Build fixes (#3)
Browse files Browse the repository at this point in the history
* Fixed Apache license identifier

* Robocop fixes

* Fixing trailing comma

* Fixed relative class name

* Fixed relative classes name

* Trying to fix rspec test cases

* Changing allowed failures in travis.yml
  • Loading branch information
brutus333 authored Jan 10, 2017
1 parent 4b8120b commit a1a6481
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 115 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ script:
matrix:
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" FUTURE_PARSER="yes" CHECK=test
- rvm: 2.1.9
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" FUTURE_PARSER="yes" CHECK=test
- rvm: 2.1.9
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.2.6
Expand Down
5 changes: 5 additions & 0 deletions examples/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include ::prometheus
include ::prometheus::node_exporter
include ::prometheus::alertmanager
include ::prometheus::alerts
include ::prometheus::statsd_exporter
8 changes: 4 additions & 4 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@
mode => '0555',
owner => 'root',
group => 'root',
content => template('prometheus/prometheus.sysv.erb')
content => template('prometheus/prometheus.sysv.erb'),
}
}
'debian' : {
file { '/etc/init.d/prometheus':
mode => '0555',
owner => 'root',
group => 'root',
content => template('prometheus/prometheus.debian.erb')
content => template('prometheus/prometheus.debian.erb'),
}
}
'sles' : {
file { '/etc/init.d/prometheus':
mode => '0555',
owner => 'root',
group => 'root',
content => template('prometheus/prometheus.sles.erb')
content => template('prometheus/prometheus.sles.erb'),
}
}
'launchd' : {
file { '/Library/LaunchDaemons/io.prometheus.daemon.plist':
mode => '0644',
owner => 'root',
group => 'wheel',
content => template('prometheus/prometheus.launchd.erb')
content => template('prometheus/prometheus.launchd.erb'),
}
}
default : {
Expand Down
2 changes: 1 addition & 1 deletion manifests/daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
) {
case $install_method {
'url': {
include staging
include ::staging
$staging_file = "${name}-${version}.${download_extension}"
$binary = "${::staging::path}/${name}-${version}.${os}-${arch}/${name}"
staging::file { $staging_file:
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
case $::prometheus::install_method {
'url': {
include staging
include ::staging
staging::file { "prometheus-${prometheus::version}.${prometheus::download_extension}":
source => $prometheus::real_download_url,
} ->
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Virgil Chereches",
"dependencies": [{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 <5.0.0"},
{"name":"nanliu/staging","version_requirement":">=0.4.0 <2.0.0"}],
"license": "Apache 2.0",
"license": "Apache-2.0",
"name": "brutus777-prometheus",
"operatingsystem_support": [
{
Expand All @@ -19,5 +19,5 @@
"source": "https://github.com/brutus333/puppet-prometheus",
"summary": "Prometheus Puppet module",
"tags": [],
"version": "0.2.00"
"version": "0.2.0"
}
51 changes: 20 additions & 31 deletions spec/classes/node_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
require 'spec_helper'

describe "prometheus::node_exporter" do
let :default_facts do
{
'operatingsystem' => 'CentOS',
'osfamily' => 'Redhat',
'operatingsystemrelease' => '7.0',
'architecture' => 'amd64',
'kernel' => 'Linux',
}
end

context 'uses the correct binary path for version' do
let(:facts) { default_facts }

let(:params) { {:version => '0.10.0', :arch => 'amd64', :os => 'linux'} }

it do
should contain_file('/usr/local/bin/node_exporter').with({
'target' => '/opt/staging/node_exporter-0.10.0.linux-amd64/node_exporter'
})
end
end

context 'uses the correct binary path for version' do
let(:facts) { default_facts }

let(:params) { {:version => '0.10.0', :arch => 'amd64', :os => 'linux'} }
describe 'prometheus::node_exporter' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge(
staging_http_get: 'curl'
)
end

it do
should contain_file('/usr/local/bin/node_exporter').with({
'target' => '/opt/staging/node_exporter-0.10.0.linux-amd64/node_exporter'
})
context 'with version specified' do
let(:params) do
{
version: '0.13.0',
arch: 'amd64',
os: 'linux'
}
end
describe 'install correct binary' do
it { is_expected.to contain_file('/usr/local/bin/node_exporter').with('target' => '/opt/staging/node_exporter-0.13.0.linux-amd64/node_exporter') }
end
end
end
end
end
Empty file.
68 changes: 0 additions & 68 deletions spec/defines/daemon_spec.rb

This file was deleted.

Empty file removed spec/fixtures/manifests/site.pp
Empty file.
5 changes: 0 additions & 5 deletions tests/init.pp

This file was deleted.

0 comments on commit a1a6481

Please sign in to comment.