reagan 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cdf319dc7aafcfdab1c853b9dc1ccc807e0cfe5
4
- data.tar.gz: 2c3f9b61287238314f851ace86fa9ea736b00dc3
3
+ metadata.gz: 7eb97fa712f2fce7de36576bdf54675b9ce31096
4
+ data.tar.gz: 516b0b9d1bae8c38a964361b8739f2a1c8301d2b
5
5
  SHA512:
6
- metadata.gz: fb69381eee4203050887b8f906913ecab3584ca7c3db68c0b711d0238813ecb669e9de2fe26227ad1c19d23c92b5d96f722d40c07b8cff0c18f66d50bae4b2ba
7
- data.tar.gz: 02b7f2e4c3505c615505f023489d1d4834879289643f73dec06673c766e7a654fb02351d355a2e0c1f79ff96b226a160c41e20b43979500fe58a717c15edbe91
6
+ metadata.gz: da189f2e45bae76d189c552725361d81311c4681be7c67b5b9ac717615b796393bde0002adbbcd39e83b918d6c29af450930d72f89210911b67b2362d3655669
7
+ data.tar.gz: 08cad4868acceff00afbf192b4a355c37f1c685be97391ade08e8ceab01335ddb78bf9d1ff61abe9477e66b271742e895e3c85761ffc724ab306fe1f48d760c3
data/.gitignore CHANGED
@@ -33,6 +33,11 @@ Gemfile.lock
33
33
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
34
  .rvmrc
35
35
 
36
+ # OS X
36
37
  .DS_Store
38
+
39
+ # reagan related files
37
40
  config.yml
38
41
 
42
+ # vi files
43
+ *.swp
@@ -13,7 +13,9 @@ HashSyntax:
13
13
  LineLength:
14
14
  Enabled: false
15
15
  MethodLength:
16
- Max: 30
16
+ Enabled: false
17
+ Metrics/AbcSize:
18
+ Enabled: false
17
19
  NumericLiterals:
18
20
  Enabled: false
19
21
  SingleSpaceBeforeFirstArg:
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.1.5
5
+ - 2.2.0
6
+ script:
7
+ - bundle exec rake test
8
+
data/Gemfile CHANGED
@@ -1,6 +1,10 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'octokit', '~> 3.0'
4
- gem 'chef', '~> 11.0'
4
+ gem 'chef', '>= 11.0'
5
5
  gem 'ridley', '~> 4.0'
6
- gem 'rake', '~> 10.0'
6
+
7
+ group :test do
8
+ gem 'rubocop', '~> 0.28.0'
9
+ gem 'rake', '~> 10.0'
10
+ end
data/bin/reagan CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
3
  # Author:: Tim Smith (<tim@cozy.co>)
4
- # Copyright:: Copyright (c) 2014 Tim Smith
4
+ # Copyright:: Copyright (c) 2015 Tim Smith
5
5
  # License:: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,15 +38,15 @@ module Reagan
38
38
  flags = { :pull => nil, :override_cookbooks => nil, :config => '/etc/reagan.yml', :print_config => false }
39
39
  OptionParser.new do |opts|
40
40
  opts.banner = 'Usage: reagan [options]'
41
- opts.on('-o', '--override cb1,cb2', 'Comma separated list of cookbooks to test') do |cookbooks|
42
- flags[:override_cookbooks] = cookbooks.split(',')
41
+ opts.on('-o', '--override cb1,cb2', Array, 'Comma separated list of cookbooks to test') do |cookbooks|
42
+ flags[:override_cookbooks] = cookbooks
43
43
  end
44
-
44
+
45
45
  opts.on('-p', '--print', 'Print the config options that will be used') do |config|
46
46
  flags[:print_config] = config
47
47
  end
48
48
 
49
- opts.on('-p', '--pull_num 123', 'Github pull number to test') do |pull|
49
+ opts.on('-p', '--pull_num 123', Integer, 'Github pull number to test') do |pull|
50
50
  flags[:pull] = pull
51
51
  end
52
52
 
@@ -70,6 +70,19 @@ module Reagan
70
70
  puts "ERROR: Reagan config at #{@flags[:config]} does not contain any configuration data"
71
71
  exit 1
72
72
  end
73
+
74
+ # if not workstation was set try to use the Jenkins workspace variable
75
+ unless config['jenkins'] && config['jenkins']['workspace_dir']
76
+ workspace = ENV['WORKSPACE']
77
+ if workspace
78
+ config['jenkins'] = {}
79
+ config['jenkins']['workspace_dir'] = workspace
80
+ else
81
+ puts 'Jenkins workspace not defined and $WORKSPACE empty. Exiting'
82
+ exit
83
+ end
84
+ end
85
+
73
86
  config
74
87
  rescue Errno::ENOENT
75
88
  puts "ERROR: Cannot load Reagan config file at #{@flags[:config]}"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'reagan'
3
- s.version = '0.8.1'
3
+ s.version = '0.8.2'
4
4
  s.date = Date.today.to_s
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.extra_rdoc_files = ['README.md', 'LICENSE']
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency 'chef', '>= 11.0'
17
17
  s.add_dependency 'ridley', '~> 4.0'
18
18
  s.add_development_dependency 'rake', '~> 10.0'
19
+ s.add_development_dependency 'rubocop', '~> 0.28.0'
19
20
 
20
21
  s.files = `git ls-files -z`.split("\x0")
21
22
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reagan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-12 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 0.28.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.28.0
69
83
  description: Trust But Verify - Ruby build script for Jenkins that automates the testing
70
84
  of Chef cookbooks
71
85
  email: tim@cozy.co
@@ -77,6 +91,7 @@ extra_rdoc_files:
77
91
  files:
78
92
  - .gitignore
79
93
  - .rubocop.yml
94
+ - .travis.yml
80
95
  - Gemfile
81
96
  - LICENSE
82
97
  - README.md