Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #19 from blkperl/puppet_lint_fixes

Fix style guide violations, add puppet lint task
  • Loading branch information...
commit c70a6cf7f1707d33eb2d707f061129aa7086e234 2 parents f9e448d + a8549c0
@rtyler authored
View
5 Gemfile
@@ -5,9 +5,10 @@ gem 'puppet'
gem 'puppet-module'
group :development do
+ gem 'cucumber'
+ gem 'puppet-lint'
gem 'rspec'
gem 'rspec-puppet'
- gem 'vagrant'
gem 'sahara'
- gem 'cucumber'
+ gem 'vagrant'
end
View
8 Rakefile
@@ -15,6 +15,12 @@ RSpec::Core::RakeTask.new(:spec_task) do |t|
t.fail_on_error = false
end
+desc "Check puppet manifests with puppet-lint"
+task :lint do
+ system("puppet-lint manifests")
+ system("puppet-lint tests")
+end
+
desc "Build package"
task :build do
sh 'puppet-module build'
@@ -23,7 +29,7 @@ end
namespace :test do
desc "Run the full integration test suite (slow!)"
- task :integration => [:spec, :build, :cucumber] do
+ task :integration => [:lint, :spec, :build, :cucumber] do
end
desc "Make sure some of the rspec-puppet directories/files are in place"
View
28 manifests/plugin.pp
@@ -1,21 +1,21 @@
define jenkins::plugin($version=0) {
- $plugin = "${name}.hpi"
- $plugin_parent_dir = "/var/lib/jenkins"
- $plugin_dir = "/var/lib/jenkins/plugins"
+ $plugin = "${name}.hpi"
+ $plugin_dir = '/var/lib/jenkins/plugins'
+ $plugin_parent_dir = '/var/lib/jenkins'
if ($version != 0) {
$base_url = "http://updates.jenkins-ci.org/download/plugins/${name}/${version}/"
}
else {
- $base_url = "http://updates.jenkins-ci.org/latest/"
+ $base_url = 'http://updates.jenkins-ci.org/latest/'
}
- if (!defined(File["${plugin_dir}"])) {
+ if (!defined(File[$plugin_dir])) {
file {
[$plugin_parent_dir, $plugin_dir]:
- owner => "jenkins",
- group => "jenkins",
ensure => directory,
+ owner => 'jenkins',
+ group => 'jenkins',
require => [Group['jenkins'], User['jenkins']];
}
}
@@ -27,9 +27,9 @@
}
}
- if (!defined(User["jenkins"])) {
+ if (!defined(User['jenkins'])) {
user {
- "jenkins" :
+ 'jenkins' :
ensure => present;
}
}
@@ -37,11 +37,11 @@
exec {
"download-${name}" :
command => "wget --no-check-certificate ${base_url}${plugin}",
- cwd => "${plugin_dir}",
- require => File["${plugin_dir}"],
- path => ["/usr/bin", "/usr/sbin",],
- user => "jenkins",
+ cwd => $plugin_dir,
+ require => File[$plugin_dir],
+ path => ['/usr/bin', '/usr/sbin',],
+ user => 'jenkins',
unless => "test -f ${plugin_dir}/${plugin}",
- notify => Service["jenkins"];
+ notify => Service['jenkins'];
}
}
View
12 manifests/repo/debian.pp
@@ -1,10 +1,10 @@
class jenkins::repo::debian {
- apt::source { "jenkins":
- location => "http://pkg.jenkins-ci.org/debian",
- release => "",
- repos => "binary/",
- key => "D50582E6",
- key_source => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
+ apt::source { 'jenkins':
+ location => 'http://pkg.jenkins-ci.org/debian',
+ release => '',
+ repos => 'binary/',
+ key => 'D50582E6',
+ key_source => 'http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key',
include_src => false,
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.