jenkins 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.2 - 2011/03/17
4
+
5
+ * add `build_details` command for fetching the result of a particular build.
6
+ * add instructions for running with non-english locale
7
+ * remove, fix obsolete gem dependencies
8
+
3
9
  ## 0.5.0 - 2010/12/1
4
10
 
5
11
  * hudson warfile no longer bundled with hudson gem
data/Gemfile.lock CHANGED
@@ -1,31 +1,29 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jenkins (0.6.1)
5
- builder (~> 2.1.2)
4
+ jenkins (0.6.2)
5
+ builder (>= 2.1.2)
6
6
  hpricot
7
7
  httparty (~> 0.6.1)
8
8
  term-ansicolor (>= 1.0.4)
9
9
  thor (~> 0.14.2)
10
- yajl-ruby (>= 0.7.6)
11
10
 
12
11
  GEM
13
12
  remote: http://rubygems.org/
14
13
  specs:
15
14
  awesome_print (0.2.1)
16
- builder (2.1.2)
15
+ builder (3.0.0)
17
16
  crack (0.1.8)
18
- cucumber (0.9.3)
19
- builder (~> 2.1.2)
17
+ cucumber (0.10.0)
18
+ builder (>= 2.1.2)
20
19
  diff-lcs (~> 1.1.2)
21
- gherkin (~> 2.2.9)
20
+ gherkin (~> 2.3.2)
22
21
  json (~> 1.4.6)
23
22
  term-ansicolor (~> 1.0.5)
24
23
  diff-lcs (1.1.2)
25
- gherkin (2.2.9)
24
+ gherkin (2.3.4)
26
25
  json (~> 1.4.6)
27
- term-ansicolor (~> 1.0.5)
28
- hpricot (0.8.3)
26
+ hpricot (0.8.4)
29
27
  httparty (0.6.1)
30
28
  crack (= 0.1.8)
31
29
  jenkins-war (1.396)
@@ -43,14 +41,13 @@ GEM
43
41
  rspec-expectations (~> 2.0.1)
44
42
  term-ansicolor (1.0.5)
45
43
  thor (0.14.6)
46
- yajl-ruby (0.7.8)
47
44
 
48
45
  PLATFORMS
49
46
  ruby
50
47
 
51
48
  DEPENDENCIES
52
49
  awesome_print
53
- cucumber (~> 0.9.0)
50
+ cucumber (~> 0.10.0)
54
51
  jenkins!
55
52
  jenkins-war (>= 1.396)
56
53
  json (~> 1.4.0)
data/README.md CHANGED
@@ -102,12 +102,17 @@ Alternately, `$JENKINS_HOST` and `$JENKINS_PORT` can be provided in lieu of the
102
102
  Developer Instructions
103
103
  ======================
104
104
 
105
- The dependencies for the gem and for developing the gem are managed by bundler.
105
+ The dependencies for the gem and for developing the gem are managed by Bundler.
106
106
 
107
107
  gem install bundler
108
108
  git clone http://github.com/cowboyd/jenkins.rb.git
109
109
  bundle install
110
110
 
111
+ The test suites expects Jenkins to speak English. If you are not using an
112
+ English locale prepare the terminal session running the test suite with:
113
+
114
+ export LC_ALL=en_US.UTF-8
115
+
111
116
  The test suite is run with:
112
117
 
113
118
  rake
@@ -0,0 +1,42 @@
1
+ Feature: Show build details
2
+ I want to see details about a particular build for a job I'm interested in
3
+
4
+ Scenario: Show build details for a job on a non-existent server (jenkins build_details)
5
+ When I run local executable "jenkins" with arguments "build_details ruby 1 --host localhost --port 9999"
6
+ Then I should see exactly
7
+ """
8
+ No connection available to the server.
9
+ """
10
+
11
+ Scenario: Show build details for a non-existent job (jenkins build_details)
12
+ Given I have a Jenkins server running
13
+ And the Jenkins server has no current jobs
14
+ When I run local executable "jenkins" with arguments "build_details ruby 1 --host localhost --port 3010"
15
+ Then I should see exactly
16
+ """
17
+ ERROR: Cannot find project 'ruby'.
18
+ """
19
+
20
+ Scenario: Show build details for a job (jenkins build_details)
21
+ Given I have a Jenkins server running
22
+ And the Jenkins server has no current jobs
23
+ And I am in the "ruby" project folder
24
+ And the project uses "git" scm
25
+ When I run local executable "jenkins" with arguments "create . --host localhost --port 3010"
26
+ When I run local executable "jenkins" with arguments "build"
27
+ When I wait for ruby build 1 to start
28
+ When I run local executable "jenkins" with arguments "build_details ruby 1 --host localhost --port 3010 --json"
29
+ Then I should see
30
+ """
31
+ "builtOn":"","result":"FAILURE","number":1,"keepLog":false,
32
+ """
33
+ And I should see
34
+ """
35
+ "actions":[{"causes":[{"userName":"anonymous","shortDescription":"Started by user anonymous"},{"userName":"anonymous","shortDescription":"Started by user anonymous"}]}],
36
+ """
37
+ And I should see
38
+ """
39
+ "description":null,"changeSet":{"kind":null,"items":[]},"fullDisplayName":"ruby #1"
40
+ """
41
+
42
+
@@ -88,6 +88,18 @@ When /^I (re|)create a job$/ do |override|
88
88
  CUCUMBER
89
89
  end
90
90
 
91
+ When /^I wait for ([\S]+) build (\d+) to start$/ do |project_name, build_number|
92
+ begin
93
+ Timeout.timeout(10) do
94
+ while !Jenkins::Api.build_details(project_name, build_number)
95
+ sleep 1
96
+ end
97
+ end
98
+ rescue TimeoutError
99
+ raise "Couldn't find build #{build_number} for project #{project_name}"
100
+ end
101
+ end
102
+
91
103
  Then /^the job "([^"]*)" config "([^"]*)" should be:$/ do |job_name, xpath, string|
92
104
  raise "Cannot yet fetch XML config from non-localhost Jenkins" unless Jenkins::Api.base_uri =~ /localhost/
93
105
  require "hpricot"
data/jenkins.gemspec CHANGED
@@ -20,14 +20,13 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  s.add_dependency("term-ansicolor", [">= 1.0.4"])
23
- s.add_dependency("yajl-ruby", [">= 0.7.6"])
24
23
  s.add_dependency("httparty", ["~> 0.6.1"])
25
- s.add_dependency("builder", ["~> 2.1.2"])
24
+ s.add_dependency("builder", [">= 2.1.2"])
26
25
  s.add_dependency("thor", ["~> 0.14.2"])
27
26
  s.add_dependency("hpricot")
28
27
  s.add_development_dependency("jenkins-war", ">= 1.396")
29
28
  s.add_development_dependency("rake", ["~> 0.8.7"])
30
- s.add_development_dependency("cucumber", ["~> 0.9.0"])
29
+ s.add_development_dependency("cucumber", ["~> 0.10.0"])
31
30
  s.add_development_dependency("rspec", ["~> 2.0.0"])
32
31
  s.add_development_dependency("json", ["~>1.4.0"])
33
32
  s.add_development_dependency("awesome_print")
data/lib/jenkins/api.rb CHANGED
@@ -99,6 +99,17 @@ module Jenkins
99
99
  end
100
100
  end
101
101
 
102
+ # Return a hash of information about a build.
103
+ def self.build_details(job_name, build_number)
104
+ begin
105
+ json = get "/job/#{job_name}/#{build_number}/api/json"
106
+ cache_base_uri
107
+ json
108
+ rescue Crack::ParseError
109
+ false
110
+ end
111
+ end
112
+
102
113
  def self.nodes
103
114
  json = get "/computer/api/json"
104
115
  cache_base_uri
data/lib/jenkins/cli.rb CHANGED
@@ -139,6 +139,30 @@ module Jenkins
139
139
  end
140
140
  end
141
141
 
142
+ desc "build_details JOB_NAME BUILD_NUMBER", "Display details about a particular build"
143
+ method_option :hash, :desc => 'Dump as formatted Ruby hash format'
144
+ method_option :json, :desc => 'Dump as JSON format'
145
+ method_option :yaml, :desc => 'Dump as YAML format'
146
+ common_options
147
+ def build_details(job_name, build_number)
148
+ select_jenkins_server(options)
149
+ if build_details = Jenkins::Api.build_details(job_name, build_number)
150
+ if options[:hash]
151
+ require "ap"
152
+ ap build_details.parsed_response
153
+ elsif options[:json]
154
+ puts build_details.parsed_response.to_json
155
+ elsif options[:yaml]
156
+ require "yaml"
157
+ puts build_details.parsed_response.to_yaml
158
+ else
159
+ error "Select an output format: --json, --yaml, --hash"
160
+ end
161
+ else
162
+ error "Cannot find project '#{job_name}'."
163
+ end
164
+ end
165
+
142
166
  desc "list [options]", "list jobs on a jenkins server"
143
167
  common_options
144
168
  def list
@@ -246,4 +270,4 @@ USEAGE
246
270
  ENV['CUCUMBER_RUNNING'] ? 'jenkins' : $0
247
271
  end
248
272
  end
249
- end
273
+ end
@@ -1,3 +1,3 @@
1
1
  module Jenkins
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jenkins
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
9
+ - 2
10
+ version: 0.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Charles Lowell
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-10 00:00:00 -06:00
19
+ date: 2011-03-18 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -35,26 +35,10 @@ dependencies:
35
35
  version: 1.0.4
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: yajl-ruby
40
- prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 15
47
- segments:
48
- - 0
49
- - 7
50
- - 6
51
- version: 0.7.6
52
- type: :runtime
53
- version_requirements: *id002
54
38
  - !ruby/object:Gem::Dependency
55
39
  name: httparty
56
40
  prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
41
+ requirement: &id002 !ruby/object:Gem::Requirement
58
42
  none: false
59
43
  requirements:
60
44
  - - ~>
@@ -66,14 +50,14 @@ dependencies:
66
50
  - 1
67
51
  version: 0.6.1
68
52
  type: :runtime
69
- version_requirements: *id003
53
+ version_requirements: *id002
70
54
  - !ruby/object:Gem::Dependency
71
55
  name: builder
72
56
  prerelease: false
73
- requirement: &id004 !ruby/object:Gem::Requirement
57
+ requirement: &id003 !ruby/object:Gem::Requirement
74
58
  none: false
75
59
  requirements:
76
- - - ~>
60
+ - - ">="
77
61
  - !ruby/object:Gem::Version
78
62
  hash: 15
79
63
  segments:
@@ -82,11 +66,11 @@ dependencies:
82
66
  - 2
83
67
  version: 2.1.2
84
68
  type: :runtime
85
- version_requirements: *id004
69
+ version_requirements: *id003
86
70
  - !ruby/object:Gem::Dependency
87
71
  name: thor
88
72
  prerelease: false
89
- requirement: &id005 !ruby/object:Gem::Requirement
73
+ requirement: &id004 !ruby/object:Gem::Requirement
90
74
  none: false
91
75
  requirements:
92
76
  - - ~>
@@ -98,11 +82,11 @@ dependencies:
98
82
  - 2
99
83
  version: 0.14.2
100
84
  type: :runtime
101
- version_requirements: *id005
85
+ version_requirements: *id004
102
86
  - !ruby/object:Gem::Dependency
103
87
  name: hpricot
104
88
  prerelease: false
105
- requirement: &id006 !ruby/object:Gem::Requirement
89
+ requirement: &id005 !ruby/object:Gem::Requirement
106
90
  none: false
107
91
  requirements:
108
92
  - - ">="
@@ -112,11 +96,11 @@ dependencies:
112
96
  - 0
113
97
  version: "0"
114
98
  type: :runtime
115
- version_requirements: *id006
99
+ version_requirements: *id005
116
100
  - !ruby/object:Gem::Dependency
117
101
  name: jenkins-war
118
102
  prerelease: false
119
- requirement: &id007 !ruby/object:Gem::Requirement
103
+ requirement: &id006 !ruby/object:Gem::Requirement
120
104
  none: false
121
105
  requirements:
122
106
  - - ">="
@@ -127,11 +111,11 @@ dependencies:
127
111
  - 396
128
112
  version: "1.396"
129
113
  type: :development
130
- version_requirements: *id007
114
+ version_requirements: *id006
131
115
  - !ruby/object:Gem::Dependency
132
116
  name: rake
133
117
  prerelease: false
134
- requirement: &id008 !ruby/object:Gem::Requirement
118
+ requirement: &id007 !ruby/object:Gem::Requirement
135
119
  none: false
136
120
  requirements:
137
121
  - - ~>
@@ -143,27 +127,27 @@ dependencies:
143
127
  - 7
144
128
  version: 0.8.7
145
129
  type: :development
146
- version_requirements: *id008
130
+ version_requirements: *id007
147
131
  - !ruby/object:Gem::Dependency
148
132
  name: cucumber
149
133
  prerelease: false
150
- requirement: &id009 !ruby/object:Gem::Requirement
134
+ requirement: &id008 !ruby/object:Gem::Requirement
151
135
  none: false
152
136
  requirements:
153
137
  - - ~>
154
138
  - !ruby/object:Gem::Version
155
- hash: 59
139
+ hash: 55
156
140
  segments:
157
141
  - 0
158
- - 9
142
+ - 10
159
143
  - 0
160
- version: 0.9.0
144
+ version: 0.10.0
161
145
  type: :development
162
- version_requirements: *id009
146
+ version_requirements: *id008
163
147
  - !ruby/object:Gem::Dependency
164
148
  name: rspec
165
149
  prerelease: false
166
- requirement: &id010 !ruby/object:Gem::Requirement
150
+ requirement: &id009 !ruby/object:Gem::Requirement
167
151
  none: false
168
152
  requirements:
169
153
  - - ~>
@@ -175,11 +159,11 @@ dependencies:
175
159
  - 0
176
160
  version: 2.0.0
177
161
  type: :development
178
- version_requirements: *id010
162
+ version_requirements: *id009
179
163
  - !ruby/object:Gem::Dependency
180
164
  name: json
181
165
  prerelease: false
182
- requirement: &id011 !ruby/object:Gem::Requirement
166
+ requirement: &id010 !ruby/object:Gem::Requirement
183
167
  none: false
184
168
  requirements:
185
169
  - - ~>
@@ -191,11 +175,11 @@ dependencies:
191
175
  - 0
192
176
  version: 1.4.0
193
177
  type: :development
194
- version_requirements: *id011
178
+ version_requirements: *id010
195
179
  - !ruby/object:Gem::Dependency
196
180
  name: awesome_print
197
181
  prerelease: false
198
- requirement: &id012 !ruby/object:Gem::Requirement
182
+ requirement: &id011 !ruby/object:Gem::Requirement
199
183
  none: false
200
184
  requirements:
201
185
  - - ">="
@@ -205,7 +189,7 @@ dependencies:
205
189
  - 0
206
190
  version: "0"
207
191
  type: :development
208
- version_requirements: *id012
192
+ version_requirements: *id011
209
193
  description: A suite of utilities for bringing continous integration to your projects (not the other way around) with jenkins CI
210
194
  email:
211
195
  - cowboyd@thefrontside.net
@@ -224,6 +208,7 @@ files:
224
208
  - README.md
225
209
  - Rakefile
226
210
  - bin/jenkins
211
+ - features/build_details.feature
227
212
  - features/default_host.feature
228
213
  - features/development.feature
229
214
  - features/launch_server.feature
@@ -347,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
332
  requirements: []
348
333
 
349
334
  rubyforge_project: jenkins
350
- rubygems_version: 1.5.0
335
+ rubygems_version: 1.6.0
351
336
  signing_key:
352
337
  specification_version: 3
353
338
  summary: Painless Continuous Integration with Jenkins Server