summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-02-23 14:48:19 +0100
committervarac <varacanero@zeromail.org>2016-02-23 14:48:19 +0100
commit4e23209eaccf1ab504d35158f4141b3053327c2f (patch)
treee9c325ad24a732b6bdb13801ef2997f10f99e02e /Rakefile
parentf92d09226cfddb0c7e5e342dd199d8ea05b497cb (diff)
parent6262d046c6993a6ae7112746210b91d46f94165e (diff)
Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-vcsrepo
Diffstat (limited to 'Rakefile')
-rwxr-xr-x[-rw-r--r--]Rakefile51
1 files changed, 40 insertions, 11 deletions
diff --git a/Rakefile b/Rakefile
index 3e005ff..7e9a13d 100644..100755
--- a/Rakefile
+++ b/Rakefile
@@ -1,13 +1,42 @@
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
+require 'puppet_blacksmith/rake_tasks'
+require 'puppet-lint/tasks/puppet-lint'
+require 'puppetlabs_spec_helper/rake_tasks'
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
+PuppetLint.configuration.fail_on_warnings = true
+PuppetLint.configuration.send('relative')
+PuppetLint.configuration.send('disable_80chars')
+PuppetLint.configuration.send('disable_class_inherits_from_params_class')
+PuppetLint.configuration.send('disable_documentation')
+PuppetLint.configuration.send('disable_single_quote_string_with_variables')
+PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
+
+desc 'Generate pooler nodesets'
+task :gen_nodeset do
+ require 'beaker-hostgenerator'
+ require 'securerandom'
+ require 'fileutils'
-task :default => :spec
+ agent_target = ENV['TEST_TARGET']
+ if ! agent_target
+ STDERR.puts 'TEST_TARGET environment variable is not set'
+ STDERR.puts 'setting to default value of "redhat-64default."'
+ agent_target = 'redhat-64default.'
+ end
+
+ master_target = ENV['MASTER_TEST_TARGET']
+ if ! master_target
+ STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
+ STDERR.puts 'setting to default value of "redhat7-64mdcl"'
+ master_target = 'redhat7-64mdcl'
+ end
+
+ targets = "#{master_target}-#{agent_target}"
+ cli = BeakerHostGenerator::CLI.new([targets])
+ nodeset_dir = "tmp/nodesets"
+ nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
+ FileUtils.mkdir_p(nodeset_dir)
+ File.open(nodeset, 'w') do |fh|
+ fh.print(cli.execute)
+ end
+ puts nodeset
+end