hudson 0.3.0.beta.5 → 0.3.0.beta.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -53,12 +53,11 @@ To list Jobs/Projects on a Hudson server:
53
53
  To add Project (create a Job) on a Hudson server:
54
54
 
55
55
  Usage: hudson create [project_path] [options]
56
- -n, --name [dir_name] name of hudson job
57
56
  -p, --port [3001] find hudson on specified port
58
57
  --host [localhost] find hudson on specified host
59
58
  -h, --help
60
59
 
61
- For all commands, if flags for `host:port` are not provided, it will use `$HUDSON_HOST` and `$HUDSON_PORT` if available.
60
+ For all commands, if flags for `host:port` are not provided, it will use either `$HUDSON_HOST` and `$HUDSON_PORT` or the previous target Hudson CI server.
62
61
 
63
62
  Developer Instructions
64
63
  ======================
@@ -32,12 +32,24 @@ Feature: Create jobs
32
32
  When I run local executable "hudson" with arguments "create . --host localhost --port 3010"
33
33
  Then I should see "Cannot determine project SCM. Currently supported:"
34
34
 
35
- Scenario: Recreate job
35
+ Scenario: Recreate a job
36
36
  Given I am in the "ruby" project folder
37
37
  When I create a job
38
38
  Then I should see "Added project 'ruby' to Hudson."
39
39
  When I recreate a job
40
40
  Then I should see "Added project 'ruby' to Hudson."
41
41
 
42
+ Scenario: Remove a job
43
+ Given I am in the "ruby" project folder
44
+ When I create a job
45
+ Then I should see "Added project 'ruby' to Hudson."
46
+ When I run local executable "hudson" with arguments "remove . --host localhost --port 3010"
47
+ Then I should see "Removed project 'ruby' from Hudson."
48
+
49
+ Scenario: Remove a job that doesn't exist gives error
50
+ Given I am in the "ruby" project folder
51
+ When I run local executable "hudson" with arguments "remove . --host localhost --port 3010"
52
+ Then I should see "ERROR: Failed to delete project 'ruby'."
53
+
42
54
 
43
55
 
@@ -2,16 +2,16 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{hudson}
5
- s.version = "0.3.0.beta.5"
5
+ s.version = "0.3.0.beta.6"
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"]
9
- s.date = %q{2010-10-27}
9
+ s.date = %q{2010-10-28}
10
10
  s.default_executable = %q{hudson}
11
11
  s.description = %q{A suite of utilities for bringing continous integration to your projects (not the other way around) with hudson CI}
12
12
  s.email = ["cowboyd@thefrontside.net", "drnicwilliams@gmail.com"]
13
13
  s.executables = ["hudson"]
14
- s.files = ["bin", "bin/hudson", "bin/hudson.compiled.rbc", "features", "features/adding_slave_nodes.feature", "features/create_jobs.feature", "features/development.feature", "features/fixtures", "features/fixtures/projects", "features/fixtures/projects/ruby", "features/fixtures/projects/ruby/Rakefile", "features/listing_jobs.feature", "features/managing_remote_servers.feature", "features/server.feature", "features/step_definitions", "features/step_definitions/common_steps.rb", "features/step_definitions/fixture_project_steps.rb", "features/step_definitions/hudson_steps.rb", "features/step_definitions/scm_steps.rb", "features/support", "features/support/common.rb", "features/support/env.rb", "features/support/hooks.rb", "features/support/matchers.rb", "Gemfile", "Gemfile.lock", "hudson.gemspec", "lib", "lib/hudson", "lib/hudson/api.rb", "lib/hudson/api.rbc", "lib/hudson/cli", "lib/hudson/cli/formatting.rb", "lib/hudson/cli.rb", "lib/hudson/config.rb", "lib/hudson/core_ext", "lib/hudson/core_ext/object", "lib/hudson/core_ext/object/blank.rb", "lib/hudson/hudson-cli.jar", "lib/hudson/hudson.war", "lib/hudson/job_config_builder.rb", "lib/hudson/plugins", "lib/hudson/plugins/git.hpi", "lib/hudson/plugins/github.hpi", "lib/hudson/plugins/greenballs.hpi", "lib/hudson/plugins/rake.hpi", "lib/hudson/plugins/ruby.hpi", "lib/hudson/project_scm.rb", "lib/hudson/remote.rb", "lib/hudson.rb", "Rakefile", "README.md", "spec", "spec/fixtures", "spec/fixtures/ec2_global.config.xml", "spec/fixtures/rails.multi.config.xml", "spec/fixtures/rails.single.config.xml", "spec/fixtures/rubygem.config.xml", "spec/fixtures/therubyracer.config.xml", "spec/job_config_builder_spec.rb", "spec/spec_helper.rb"]
14
+ s.files = ["bin", "bin/hudson", "features", "features/development.feature", "features/fixtures", "features/fixtures/projects", "features/fixtures/projects/ruby", "features/fixtures/projects/ruby/Rakefile", "features/listing_jobs.feature", "features/manage_jobs.feature", "features/manage_remote_servers.feature", "features/manage_slave_nodes.feature", "features/server.feature", "features/step_definitions", "features/step_definitions/common_steps.rb", "features/step_definitions/fixture_project_steps.rb", "features/step_definitions/hudson_steps.rb", "features/step_definitions/scm_steps.rb", "features/support", "features/support/common.rb", "features/support/env.rb", "features/support/hooks.rb", "features/support/matchers.rb", "Gemfile", "Gemfile.lock", "hudson.gemspec", "lib", "lib/hudson", "lib/hudson/api.rb", "lib/hudson/cli", "lib/hudson/cli/formatting.rb", "lib/hudson/cli.rb", "lib/hudson/config.rb", "lib/hudson/core_ext", "lib/hudson/core_ext/object", "lib/hudson/core_ext/object/blank.rb", "lib/hudson/hudson-cli.jar", "lib/hudson/hudson.war", "lib/hudson/job_config_builder.rb", "lib/hudson/plugins", "lib/hudson/plugins/git.hpi", "lib/hudson/plugins/github.hpi", "lib/hudson/plugins/greenballs.hpi", "lib/hudson/plugins/rake.hpi", "lib/hudson/plugins/ruby.hpi", "lib/hudson/project_scm.rb", "lib/hudson/remote.rb", "lib/hudson.rb", "Rakefile", "README.md", "spec", "spec/fixtures", "spec/fixtures/ec2_global.config.xml", "spec/fixtures/rails.multi.config.xml", "spec/fixtures/rails.single.config.triggers.xml", "spec/fixtures/rails.single.config.xml", "spec/fixtures/rubygem.config.xml", "spec/fixtures/therubyracer.config.xml", "spec/job_config_builder_spec.rb", "spec/spec_helper.rb"]
15
15
  s.homepage = %q{http://github.com/cowboyd/hudson.rb}
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{hudson}
@@ -1,5 +1,5 @@
1
1
  module Hudson
2
- VERSION = "0.3.0.beta.5"
2
+ VERSION = "0.3.0.beta.6"
3
3
  HUDSON_VERSION = "1.380"
4
4
  WAR = File.expand_path(File.dirname(__FILE__) + "/hudson/hudson.war")
5
5
  PLUGINS = File.expand_path(File.dirname(__FILE__) + "/hudson/plugins")
@@ -43,6 +43,7 @@ module Hudson
43
43
  cache_base_uri
44
44
  true
45
45
  else
46
+ puts res.body
46
47
  if res.body =~ /A job already exists with the name/
47
48
  if options[:override]
48
49
  delete_job(name)
@@ -61,8 +62,9 @@ module Hudson
61
62
 
62
63
  # Attempts to delete a job +name+
63
64
  def self.delete_job(name)
64
- post "/job/#{name}/doDelete/api/json"
65
- rescue Crack::ParseError
65
+ uri = URI.parse base_uri
66
+ res = Net::HTTP.start(uri.host, uri.port) { |http| http.post("#{job_url name}/doDelete", {}) }
67
+ res.code.to_i == 302
66
68
  end
67
69
 
68
70
  def self.summary
@@ -154,5 +156,9 @@ module Hudson
154
156
  Hudson::Config.config["base_uri"] = base_uri
155
157
  Hudson::Config.store!
156
158
  end
159
+
160
+ def self.job_url(name)
161
+ "#{base_uri}/job/#{name}"
162
+ end
157
163
  end
158
164
  end
@@ -46,11 +46,10 @@ module Hudson
46
46
  exec(*cmd)
47
47
  end
48
48
 
49
- desc "create [project_path] [options]", "create a continuous build for your project"
49
+ desc "create project_path [options]", "create a build for your project"
50
50
  common_options
51
- method_option :name, :banner => "dir_name", :desc => "name of the build"
52
51
  method_option :override, :desc => "override if job exists", :type => :boolean, :default => false
53
- def create(project_path = ".")
52
+ def create(project_path)
54
53
  select_hudson_server(options)
55
54
  FileUtils.chdir(project_path) do
56
55
  unless scm = Hudson::ProjectScm.discover
@@ -59,7 +58,7 @@ module Hudson
59
58
  job_config = Hudson::JobConfigBuilder.new(:rubygem) do |c|
60
59
  c.scm = scm.url
61
60
  end
62
- name = options[:name] || File.basename(FileUtils.pwd)
61
+ name = File.basename(FileUtils.pwd)
63
62
  if Hudson::Api.create_job(name, job_config, {:override => options[:override]})
64
63
  build_url = "#{@uri}/job/#{name.gsub(/\s/,'%20')}/build"
65
64
  puts "Added project '#{name}' to Hudson."
@@ -69,6 +68,20 @@ module Hudson
69
68
  end
70
69
  end
71
70
  end
71
+
72
+ desc "remove PROJECT_PATH", "remove this project's build job from Hudson"
73
+ common_options
74
+ def remove(project_path)
75
+ select_hudson_server(options)
76
+ FileUtils.chdir(project_path) do
77
+ name = File.basename(FileUtils.pwd)
78
+ if Hudson::Api.delete_job(name)
79
+ puts "Removed project '#{name}' from Hudson."
80
+ else
81
+ error "Failed to delete project '#{name}'."
82
+ end
83
+ end
84
+ end
72
85
 
73
86
  desc "list [options]", "list jobs on a hudson server"
74
87
  common_options
@@ -27,10 +27,10 @@ module Hudson
27
27
  b.properties
28
28
  build_scm b
29
29
  b.assignedNode assigned_node if assigned_node
30
- b.canRoam true
30
+ b.canRoam !assigned_node
31
31
  b.disabled false
32
32
  b.blockBuildWhenUpstreamBuilding false
33
- build_triggers b
33
+ # build_triggers b
34
34
  b.concurrentBuild false
35
35
  build_axes b if matrix_project
36
36
  build_steps b
@@ -36,12 +36,6 @@
36
36
  <canRoam>true</canRoam>
37
37
  <disabled>false</disabled>
38
38
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
39
- <triggers class="vector">
40
- <hudson.triggers.SCMTrigger>
41
- <spec># every minute
42
- * * * * *</spec>
43
- </hudson.triggers.SCMTrigger>
44
- </triggers>
45
39
  <concurrentBuild>false</concurrentBuild>
46
40
  <axes>
47
41
  </axes>
@@ -0,0 +1,84 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project>
3
+ <actions/>
4
+ <description/>
5
+ <keepDependencies>false</keepDependencies>
6
+ <properties/>
7
+ <scm class="hudson.plugins.git.GitSCM">
8
+ <configVersion>1</configVersion>
9
+ <remoteRepositories>
10
+ <org.spearce.jgit.transport.RemoteConfig>
11
+ <string>origin</string>
12
+ <int>5</int>
13
+ <string>fetch</string>
14
+ <string>+refs/heads/*:refs/remotes/origin/*</string>
15
+ <string>receivepack</string>
16
+ <string>git-upload-pack</string>
17
+ <string>uploadpack</string>
18
+ <string>git-upload-pack</string>
19
+ <string>url</string>
20
+ <string>git@codebasehq.com:mocra/misc/mocra-web.git</string>
21
+ <string>tagopt</string>
22
+ <string/>
23
+ </org.spearce.jgit.transport.RemoteConfig>
24
+ </remoteRepositories>
25
+ <branches>
26
+ <hudson.plugins.git.BranchSpec>
27
+ <name>master</name>
28
+ </hudson.plugins.git.BranchSpec>
29
+ </branches>
30
+ <mergeOptions/>
31
+ <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
32
+ <clean>false</clean>
33
+ <choosingStrategy>Default</choosingStrategy>
34
+ <submoduleCfg class="list"/>
35
+ </scm>
36
+ <canRoam>true</canRoam>
37
+ <disabled>false</disabled>
38
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
39
+ <triggers class="vector">
40
+ <hudson.triggers.SCMTrigger>
41
+ <spec># every minute
42
+ * * * * *</spec>
43
+ </hudson.triggers.SCMTrigger>
44
+ </triggers>
45
+ <concurrentBuild>false</concurrentBuild>
46
+ <builders>
47
+ <hudson.plugins.ruby.Ruby>
48
+ <command>
49
+ unless File.exist?(&quot;config/database.yml&quot;)
50
+ require &apos;fileutils&apos;
51
+ example = Dir[&quot;config/database*&quot;].first
52
+ puts &quot;Using #{example} for config/database.yml&quot;
53
+ FileUtils.cp example, &quot;config/database.yml&quot;
54
+ end
55
+ </command>
56
+ </hudson.plugins.ruby.Ruby>
57
+ <hudson.plugins.rake.Rake>
58
+ <rakeInstallation>(Default)</rakeInstallation>
59
+ <rakeFile/>
60
+ <rakeLibDir/>
61
+ <rakeWorkingDir/>
62
+ <tasks>db:schema:load</tasks>
63
+ <silent>false</silent>
64
+ </hudson.plugins.rake.Rake>
65
+ <hudson.plugins.rake.Rake>
66
+ <rakeInstallation>(Default)</rakeInstallation>
67
+ <rakeFile/>
68
+ <rakeLibDir/>
69
+ <rakeWorkingDir/>
70
+ <tasks>features</tasks>
71
+ <silent>false</silent>
72
+ </hudson.plugins.rake.Rake>
73
+ <hudson.plugins.rake.Rake>
74
+ <rakeInstallation>(Default)</rakeInstallation>
75
+ <rakeFile/>
76
+ <rakeLibDir/>
77
+ <rakeWorkingDir/>
78
+ <tasks>spec</tasks>
79
+ <silent>false</silent>
80
+ </hudson.plugins.rake.Rake>
81
+ </builders>
82
+ <publishers/>
83
+ <buildWrappers/>
84
+ </project>
@@ -36,12 +36,6 @@
36
36
  <canRoam>true</canRoam>
37
37
  <disabled>false</disabled>
38
38
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
39
- <triggers class="vector">
40
- <hudson.triggers.SCMTrigger>
41
- <spec># every minute
42
- * * * * *</spec>
43
- </hudson.triggers.SCMTrigger>
44
- </triggers>
45
39
  <concurrentBuild>false</concurrentBuild>
46
40
  <builders>
47
41
  <hudson.plugins.ruby.Ruby>
@@ -36,12 +36,6 @@
36
36
  <canRoam>true</canRoam>
37
37
  <disabled>false</disabled>
38
38
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
39
- <triggers class="vector">
40
- <hudson.triggers.SCMTrigger>
41
- <spec># every minute
42
- * * * * *</spec>
43
- </hudson.triggers.SCMTrigger>
44
- </triggers>
45
39
  <concurrentBuild>false</concurrentBuild>
46
40
  <axes/>
47
41
  <builders>
@@ -37,6 +37,7 @@ describe Hudson::JobConfigBuilder do
37
37
  it "builds config.xml" do
38
38
  Hpricot.XML(@config.to_xml).search("assignedNode").size.should == 1
39
39
  Hpricot.XML(@config.to_xml).search("assignedNode").text.should == "my-slave"
40
+ Hpricot.XML(@config.to_xml).search("canRoam").text.should == "false"
40
41
  end
41
42
  end
42
43
 
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: 62196377
4
+ hash: 62196383
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
9
  - 0
10
10
  - beta
11
- - 5
12
- version: 0.3.0.beta.5
11
+ - 6
12
+ version: 0.3.0.beta.6
13
13
  platform: ruby
14
14
  authors:
15
15
  - Charles Lowell
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2010-10-27 00:00:00 -07:00
21
+ date: 2010-10-28 00:00:00 -07:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -205,13 +205,12 @@ extra_rdoc_files: []
205
205
 
206
206
  files:
207
207
  - bin/hudson
208
- - bin/hudson.compiled.rbc
209
- - features/adding_slave_nodes.feature
210
- - features/create_jobs.feature
211
208
  - features/development.feature
212
209
  - features/fixtures/projects/ruby/Rakefile
213
210
  - features/listing_jobs.feature
214
- - features/managing_remote_servers.feature
211
+ - features/manage_jobs.feature
212
+ - features/manage_remote_servers.feature
213
+ - features/manage_slave_nodes.feature
215
214
  - features/server.feature
216
215
  - features/step_definitions/common_steps.rb
217
216
  - features/step_definitions/fixture_project_steps.rb
@@ -225,7 +224,6 @@ files:
225
224
  - Gemfile.lock
226
225
  - hudson.gemspec
227
226
  - lib/hudson/api.rb
228
- - lib/hudson/api.rbc
229
227
  - lib/hudson/cli/formatting.rb
230
228
  - lib/hudson/cli.rb
231
229
  - lib/hudson/config.rb
@@ -245,6 +243,7 @@ files:
245
243
  - README.md
246
244
  - spec/fixtures/ec2_global.config.xml
247
245
  - spec/fixtures/rails.multi.config.xml
246
+ - spec/fixtures/rails.single.config.triggers.xml
248
247
  - spec/fixtures/rails.single.config.xml
249
248
  - spec/fixtures/rubygem.config.xml
250
249
  - spec/fixtures/therubyracer.config.xml
@@ -1,197 +0,0 @@
1
- !RBIX
2
- 0
3
- x
4
- M
5
- 1
6
- n
7
- n
8
- x
9
- 10
10
- __script__
11
- i
12
- 89
13
- 5
14
- 7
15
- 0
16
- 64
17
- 47
18
- 49
19
- 1
20
- 1
21
- 15
22
- 99
23
- 43
24
- 2
25
- 7
26
- 3
27
- 49
28
- 4
29
- 1
30
- 45
31
- 5
32
- 6
33
- 45
34
- 5
35
- 7
36
- 45
37
- 5
38
- 8
39
- 65
40
- 49
41
- 9
42
- 0
43
- 49
44
- 10
45
- 1
46
- 7
47
- 11
48
- 64
49
- 81
50
- 12
51
- 49
52
- 10
53
- 1
54
- 49
55
- 13
56
- 1
57
- 49
58
- 14
59
- 1
60
- 15
61
- 5
62
- 45
63
- 5
64
- 15
65
- 65
66
- 49
67
- 9
68
- 0
69
- 49
70
- 10
71
- 1
72
- 7
73
- 16
74
- 64
75
- 81
76
- 12
77
- 47
78
- 49
79
- 1
80
- 1
81
- 15
82
- 5
83
- 7
84
- 17
85
- 64
86
- 47
87
- 49
88
- 1
89
- 1
90
- 15
91
- 45
92
- 18
93
- 19
94
- 43
95
- 20
96
- 49
97
- 21
98
- 0
99
- 15
100
- 2
101
- 11
102
- I
103
- 5
104
- I
105
- 0
106
- I
107
- 0
108
- I
109
- 0
110
- n
111
- p
112
- 22
113
- s
114
- 8
115
- rubygems
116
- x
117
- 7
118
- require
119
- x
120
- 7
121
- Globals
122
- x
123
- 2
124
- $:
125
- x
126
- 2
127
- []
128
- x
129
- 4
130
- File
131
- n
132
- n
133
- n
134
- x
135
- 11
136
- active_path
137
- x
138
- 7
139
- dirname
140
- s
141
- 17
142
- /../lib/hudson.rb
143
- x
144
- 1
145
- +
146
- x
147
- 11
148
- expand_path
149
- x
150
- 7
151
- unshift
152
- n
153
- s
154
- 14
155
- /../lib/hudson
156
- s
157
- 10
158
- hudson/cli
159
- x
160
- 6
161
- Hudson
162
- n
163
- x
164
- 3
165
- CLI
166
- x
167
- 5
168
- start
169
- p
170
- 11
171
- I
172
- 0
173
- I
174
- 2
175
- I
176
- 9
177
- I
178
- 3
179
- I
180
- 30
181
- I
182
- 4
183
- I
184
- 45
185
- I
186
- 5
187
- I
188
- 4e
189
- I
190
- 7
191
- I
192
- 59
193
- x
194
- 47
195
- /Users/drnic/Projects/gems/hudson.rb/bin/hudson
196
- p
197
- 0