hudson 0.3.0.beta.7 → 0.3.0.beta.8
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.
- data/Gemfile.lock +6 -6
- data/Rakefile +1 -1
- data/hudson.gemspec +4 -4
- data/lib/hudson.rb +1 -1
- data/lib/hudson/api.rb +17 -22
- data/lib/hudson/cli.rb +11 -9
- metadata +7 -7
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hudson (0.3.0.beta.
|
4
|
+
hudson (0.3.0.beta.8)
|
5
5
|
builder (~> 2.1.2)
|
6
6
|
hpricot
|
7
|
-
httparty (~> 0.
|
7
|
+
httparty (~> 0.6.1)
|
8
8
|
term-ansicolor (>= 1.0.4)
|
9
9
|
thor (= 0.14.2)
|
10
10
|
yajl-ruby (>= 0.7.6)
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
specs:
|
15
15
|
awesome_print (0.2.1)
|
16
16
|
builder (2.1.2)
|
17
|
-
crack (0.1.
|
17
|
+
crack (0.1.8)
|
18
18
|
cucumber (0.9.3)
|
19
19
|
builder (~> 2.1.2)
|
20
20
|
diff-lcs (~> 1.1.2)
|
@@ -26,8 +26,8 @@ GEM
|
|
26
26
|
json (~> 1.4.6)
|
27
27
|
term-ansicolor (~> 1.0.5)
|
28
28
|
hpricot (0.8.2)
|
29
|
-
httparty (0.
|
30
|
-
crack (= 0.1.
|
29
|
+
httparty (0.6.1)
|
30
|
+
crack (= 0.1.8)
|
31
31
|
json (1.4.6)
|
32
32
|
rake (0.8.7)
|
33
33
|
rspec (2.0.1)
|
@@ -52,7 +52,7 @@ DEPENDENCIES
|
|
52
52
|
builder (~> 2.1.2)
|
53
53
|
cucumber (~> 0.9.0)
|
54
54
|
hpricot
|
55
|
-
httparty (~> 0.
|
55
|
+
httparty (~> 0.6.1)
|
56
56
|
hudson!
|
57
57
|
json (~> 1.4.0)
|
58
58
|
rake (~> 0.8.7)
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
end.to_a
|
21
21
|
s.add_dependency("term-ansicolor", [">= 1.0.4"])
|
22
22
|
s.add_dependency("yajl-ruby", [">= 0.7.6"])
|
23
|
-
s.add_dependency("httparty", ["~> 0.
|
23
|
+
s.add_dependency("httparty", ["~> 0.6.1"])
|
24
24
|
s.add_dependency("builder", ["~> 2.1.2"])
|
25
25
|
s.add_dependency("thor", ["= 0.14.2"])
|
26
26
|
s.add_dependency("hpricot")
|
data/hudson.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{hudson}
|
5
|
-
s.version = "0.3.0.beta.
|
5
|
+
s.version = "0.3.0.beta.8"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Charles Lowell", "Dr Nic Williams"]
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
26
|
s.add_runtime_dependency(%q<term-ansicolor>, [">= 1.0.4"])
|
27
27
|
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0.7.6"])
|
28
|
-
s.add_runtime_dependency(%q<httparty>, ["~> 0.
|
28
|
+
s.add_runtime_dependency(%q<httparty>, ["~> 0.6.1"])
|
29
29
|
s.add_runtime_dependency(%q<builder>, ["~> 2.1.2"])
|
30
30
|
s.add_runtime_dependency(%q<thor>, ["= 0.14.2"])
|
31
31
|
s.add_runtime_dependency(%q<hpricot>, [">= 0"])
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
else
|
38
38
|
s.add_dependency(%q<term-ansicolor>, [">= 1.0.4"])
|
39
39
|
s.add_dependency(%q<yajl-ruby>, [">= 0.7.6"])
|
40
|
-
s.add_dependency(%q<httparty>, ["~> 0.
|
40
|
+
s.add_dependency(%q<httparty>, ["~> 0.6.1"])
|
41
41
|
s.add_dependency(%q<builder>, ["~> 2.1.2"])
|
42
42
|
s.add_dependency(%q<thor>, ["= 0.14.2"])
|
43
43
|
s.add_dependency(%q<hpricot>, [">= 0"])
|
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
|
|
50
50
|
else
|
51
51
|
s.add_dependency(%q<term-ansicolor>, [">= 1.0.4"])
|
52
52
|
s.add_dependency(%q<yajl-ruby>, [">= 0.7.6"])
|
53
|
-
s.add_dependency(%q<httparty>, ["~> 0.
|
53
|
+
s.add_dependency(%q<httparty>, ["~> 0.6.1"])
|
54
54
|
s.add_dependency(%q<builder>, ["~> 2.1.2"])
|
55
55
|
s.add_dependency(%q<thor>, ["= 0.14.2"])
|
56
56
|
s.add_dependency(%q<hpricot>, [">= 0"])
|
data/lib/hudson.rb
CHANGED
data/lib/hudson/api.rb
CHANGED
@@ -11,7 +11,7 @@ module Hudson
|
|
11
11
|
|
12
12
|
headers 'content-type' => 'application/json'
|
13
13
|
format :json
|
14
|
-
|
14
|
+
http_proxy 'localhost', '8888'
|
15
15
|
|
16
16
|
JobAlreadyExistsError = Class.new(Exception)
|
17
17
|
|
@@ -36,31 +36,26 @@ module Hudson
|
|
36
36
|
#
|
37
37
|
# TODO Exceptions?
|
38
38
|
def self.create_job(name, job_config, options = {})
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
true
|
45
|
-
else
|
39
|
+
delete_job(name) if options[:override]
|
40
|
+
begin
|
41
|
+
res = post "/createItem/api/xml?name=#{CGI.escape(name)}", {
|
42
|
+
:body => job_config.to_xml, :format => :xml, :headers => { 'content-type' => 'application/xml' }
|
43
|
+
}
|
46
44
|
p res.code
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
else
|
52
|
-
raise JobAlreadyExistsError.new(name)
|
53
|
-
end
|
45
|
+
puts res.body
|
46
|
+
if res.code == 200
|
47
|
+
cache_base_uri
|
48
|
+
true
|
54
49
|
else
|
50
|
+
# TODO - what are the errors we get?
|
55
51
|
puts "Server error:"
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
rescue
|
60
|
-
puts res.body
|
61
|
-
end
|
52
|
+
p res.code
|
53
|
+
puts res.body
|
54
|
+
false
|
62
55
|
end
|
63
|
-
|
56
|
+
rescue REXML::ParseException => e
|
57
|
+
# For some reason, if the job exists we get back half a page of HTML
|
58
|
+
raise JobAlreadyExistsError.new(name)
|
64
59
|
end
|
65
60
|
end
|
66
61
|
|
data/lib/hudson/cli.rb
CHANGED
@@ -55,16 +55,18 @@ module Hudson
|
|
55
55
|
unless scm = Hudson::ProjectScm.discover
|
56
56
|
error "Cannot determine project SCM. Currently supported: #{Hudson::ProjectScm.supported}"
|
57
57
|
end
|
58
|
-
job_config = Hudson::JobConfigBuilder.new(:rubygem)
|
59
|
-
c.scm = scm.url
|
60
|
-
end
|
58
|
+
job_config = Hudson::JobConfigBuilder.new(:rubygem) { |c| c.scm = scm.url }
|
61
59
|
name = File.basename(FileUtils.pwd)
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
begin
|
61
|
+
if Hudson::Api.create_job(name, job_config, options)
|
62
|
+
build_url = "#{@uri}/job/#{name.gsub(/\s/,'%20')}/build"
|
63
|
+
puts "Added project '#{name}' to Hudson."
|
64
|
+
puts "Trigger builds via: #{build_url}"
|
65
|
+
else
|
66
|
+
error "Failed to create project '#{name}'"
|
67
|
+
end
|
68
|
+
rescue Hudson::Api::JobAlreadyExistsError
|
69
|
+
error "Job '#{name} already exists."
|
68
70
|
end
|
69
71
|
end
|
70
72
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hudson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196355
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 0.3.0.beta.
|
11
|
+
- 8
|
12
|
+
version: 0.3.0.beta.8
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Charles Lowell
|
@@ -59,12 +59,12 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
hash:
|
62
|
+
hash: 5
|
63
63
|
segments:
|
64
64
|
- 0
|
65
|
-
-
|
66
|
-
-
|
67
|
-
version: 0.
|
65
|
+
- 6
|
66
|
+
- 1
|
67
|
+
version: 0.6.1
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
name: httparty
|