reagan 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0768ae5db6dcb4bdcbbe702be3806dd3ab4a80f
4
- data.tar.gz: 402af8fd05ba6df63bfddb6ec7beafb6b0c0bb99
3
+ metadata.gz: 595b4ab40fd53bd6edbacf0973d37684775097f0
4
+ data.tar.gz: 6dc4f438d84176c5aada6fc746de42e45d3b26c4
5
5
  SHA512:
6
- metadata.gz: efd32feff08fc2418a95582ffaa0d63ee2ee13c225f4754c79c7e8f4cbfb961cdbb8fe33beabb79d4fd49b258a8e044b6defd8c735a032af12903f4f7fd10925
7
- data.tar.gz: 422c0a0347a520847ea2681160f411db829c793764df1d7ddc2702ec730f4cec99f9c8365ff9c7a86484f55d26b40273f66461d04a2e7e65b159d5e3c356e415
6
+ metadata.gz: ab321ce160654cd5966e23ea2823b2ab0de6c72cf62cce006cca1cba12561f28ce35344182e7f3b266dca8ac85f76f2f8b1f9dfe8ef831c87c657982c7dfeb3c
7
+ data.tar.gz: 674c59378f7b64875394010b9c58c04aa2f8804d1558f145c4e43636dffb227d326176851a585ba50fe6b4caa3273237df8e9d95251238c1401a7049efb87c89
data/README.md CHANGED
@@ -10,3 +10,13 @@ Trust But Verify - Ruby Jenkins build script that automates the testing of Chef
10
10
  * octokit
11
11
  * chef
12
12
  * reidley
13
+
14
+ ## Running Locally
15
+ While this app is written to be run as a Jenkins job it can also be run locally. This is particularly useful when you want to run the tests prior to commit. To run Reagan locally use the following command line options:
16
+
17
+ * -c /path/to/reagan.yml
18
+ * -o overide,list,of,comma,separated,cookbooks
19
+ * -p 123 pull request number to manually test
20
+
21
+ ##Running in Jenkins
22
+ coming soon!
data/bin/reagan CHANGED
@@ -22,18 +22,22 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
22
22
  require 'reagan'
23
23
  require 'optparse'
24
24
 
25
- options = { :pull => nil, :cookbooks => nil }
25
+ options = { :pull => nil, :cookbooks => nil, :config => '/etc/reagan.yml' }
26
26
 
27
27
  parser = OptionParser.new do |opts|
28
28
  opts.banner = 'Usage: reagan [options]'
29
- opts.on('-c', '--cookbooks cookbook', 'Cookbooks to test (comma separated)') do |cookbooks|
29
+ opts.on('-o', '--override cb1,cb2', 'Comma separated list of cookbooks to test') do |cookbooks|
30
30
  options[:cookbooks] = cookbooks
31
31
  end
32
32
 
33
- opts.on('-p', '--pull_num num', 'Pull Number to test') do |pull|
33
+ opts.on('-p', '--pull_num 123', 'Github pull number to test') do |pull|
34
34
  options[:pull] = pull
35
35
  end
36
36
 
37
+ opts.on('-c', '--config reagan.yml', 'Path to config file (defaults to /etc/reagan.yml)') do |config|
38
+ options[:config] = config
39
+ end
40
+
37
41
  opts.on('-h', '--help', 'Displays Help') do
38
42
  puts opts
39
43
  exit
data/lib/reagan.rb CHANGED
@@ -25,7 +25,7 @@ class Reagan
25
25
 
26
26
  attr_accessor :config
27
27
  def initialize(options)
28
- @@config = YAML.load_file('/etc/reagan.yml')
28
+ @@config = YAML.load_file(options[:config])
29
29
  @options = options
30
30
  end
31
31
 
data/lib/test_knife.rb CHANGED
@@ -29,7 +29,7 @@ class TestKnife < Reagan
29
29
  result = system "knife cookbook test -o #{File.join(@@config['jenkins']['workspace_dir'], 'cookbooks')} #{@cookbook} > /dev/null 2>&1"
30
30
 
31
31
  puts 'Running knife cookbook test:'
32
- puts result ? ' PASS: Knife cookbook test was successful' : 'FAIL: Knife cookbookk test was NOT successful'
32
+ puts result ? ' PASS: Knife cookbook test was successful' : ' FAIL: Knife cookbookk test was NOT successful'
33
33
  result
34
34
  end
35
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reagan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Smith