hudson 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.gitignore +1 -0
  2. data/Changelog.md +3 -0
  3. data/Gemfile.lock +11 -43
  4. data/README.md +3 -151
  5. data/Rakefile +0 -77
  6. data/bin/hudson +2 -10
  7. data/hudson.gemspec +2 -12
  8. data/lib/hudson.rb +1 -8
  9. data/lib/hudson/version.rb +1 -1
  10. metadata +8 -203
  11. data/features/default_host.feature +0 -19
  12. data/features/development.feature +0 -14
  13. data/features/launch_server.feature +0 -17
  14. data/features/listing_jobs.feature +0 -34
  15. data/features/manage_jobs.feature +0 -207
  16. data/features/manage_slave_nodes.feature +0 -80
  17. data/features/step_definitions/common_steps.rb +0 -197
  18. data/features/step_definitions/fixture_project_steps.rb +0 -8
  19. data/features/step_definitions/hudson_steps.rb +0 -104
  20. data/features/step_definitions/scm_steps.rb +0 -12
  21. data/features/support/common.rb +0 -37
  22. data/features/support/env.rb +0 -14
  23. data/features/support/hooks.rb +0 -16
  24. data/features/support/hudson_helpers.rb +0 -6
  25. data/features/support/matchers.rb +0 -10
  26. data/lib/hudson/api.rb +0 -219
  27. data/lib/hudson/cli.rb +0 -253
  28. data/lib/hudson/cli/formatting.rb +0 -53
  29. data/lib/hudson/config.rb +0 -27
  30. data/lib/hudson/core_ext/hash.rb +0 -9
  31. data/lib/hudson/core_ext/object/blank.rb +0 -77
  32. data/lib/hudson/hudson-cli.jar +0 -0
  33. data/lib/hudson/installation.rb +0 -136
  34. data/lib/hudson/job_config_builder.rb +0 -287
  35. data/lib/hudson/project_scm.rb +0 -22
  36. data/lib/hudson/remote.rb +0 -11
  37. data/spec/fixtures/ec2_global.config.xml +0 -103
  38. data/spec/fixtures/rails.multi.config.xml +0 -82
  39. data/spec/fixtures/rails.single.config.triggers.xml +0 -84
  40. data/spec/fixtures/rails.single.config.xml +0 -80
  41. data/spec/fixtures/ruby.multi-ruby-multi-labels.config.xml +0 -84
  42. data/spec/fixtures/ruby.multi.config.xml +0 -77
  43. data/spec/fixtures/ruby.single.config.xml +0 -58
  44. data/spec/fixtures/therubyracer.config.xml +0 -77
  45. data/spec/hash_key_cleaner_spec.rb +0 -25
  46. data/spec/job_config_builder_spec.rb +0 -137
  47. data/spec/spec_helper.rb +0 -15
@@ -1,77 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <matrix-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>http://github.com/drnic/picasa_plucker.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
- <localBranch/>
31
- <mergeOptions/>
32
- <recursiveSubmodules>false</recursiveSubmodules>
33
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
34
- <authorOrCommitter>false</authorOrCommitter>
35
- <clean>false</clean>
36
- <wipeOutWorkspace>false</wipeOutWorkspace>
37
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
38
- <gitTool>Default</gitTool>
39
- <submoduleCfg class="list"/>
40
- <relativeTargetDir/>
41
- <excludedRegions/>
42
- <excludedUsers/>
43
- </scm>
44
- <canRoam>true</canRoam>
45
- <disabled>false</disabled>
46
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
47
- <triggers class="vector"/>
48
- <concurrentBuild>false</concurrentBuild>
49
- <axes>
50
- <hudson.matrix.TextAxis>
51
- <name>RUBY_VERSION</name>
52
- <values>
53
- <string>1.8.7</string>
54
- <string>1.9.2</string>
55
- <string>rbx-head</string>
56
- <string>jruby</string>
57
- </values>
58
- </hudson.matrix.TextAxis>
59
- </axes>
60
- <builders>
61
- <hudson.tasks.Shell>
62
- <command>rvm $RUBY_VERSION</command>
63
- </hudson.tasks.Shell>
64
- <hudson.tasks.Shell>
65
- <command>rvm gemset create ruby-$RUBY_VERSION &amp;&amp; rvm gemset use ruby-$RUBY_VERSION</command>
66
- </hudson.tasks.Shell>
67
- <hudson.tasks.Shell>
68
- <command>bundle install</command>
69
- </hudson.tasks.Shell>
70
- <hudson.tasks.Shell>
71
- <command>bundle exec rake</command>
72
- </hudson.tasks.Shell>
73
- </builders>
74
- <publishers/>
75
- <buildWrappers/>
76
- <runSequentially>false</runSequentially>
77
- </matrix-project>
@@ -1,58 +0,0 @@
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
- <localBranch/>
31
- <mergeOptions/>
32
- <recursiveSubmodules>false</recursiveSubmodules>
33
- <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
34
- <authorOrCommitter>false</authorOrCommitter>
35
- <clean>false</clean>
36
- <wipeOutWorkspace>false</wipeOutWorkspace>
37
- <buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
38
- <gitTool>Default</gitTool>
39
- <submoduleCfg class="list"/>
40
- <relativeTargetDir/>
41
- <excludedRegions/>
42
- <excludedUsers/>
43
- </scm>
44
- <canRoam>true</canRoam>
45
- <disabled>false</disabled>
46
- <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
47
- <concurrentBuild>false</concurrentBuild>
48
- <builders>
49
- <hudson.tasks.Shell>
50
- <command>bundle install</command>
51
- </hudson.tasks.Shell>
52
- <hudson.tasks.Shell>
53
- <command>bundle exec rake</command>
54
- </hudson.tasks.Shell>
55
- </builders>
56
- <publishers/>
57
- <buildWrappers/>
58
- </project>
@@ -1,77 +0,0 @@
1
- <?xml version='1.0' encoding='UTF-8'?>
2
- <matrix-project>
3
- <actions/>
4
- <description></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://github.com/cowboyd/therubyracer.git</string>
21
- <string>tagopt</string>
22
- <string></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>true</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
- <concurrentBuild>false</concurrentBuild>
41
- <axes>
42
- <axis>
43
- <name>RUBY_VERSION</name>
44
- <values>
45
- <string>1.8.6</string>
46
- <string>1.8.7</string>
47
- <string>1.9.1</string>
48
- </values>
49
- </axis>
50
- <axis>
51
- <name>label</name>
52
- <values>
53
- <string>OSX-Leopard-10.5</string>
54
- <string>Ubuntu-Lucid-10.04-server-amd64</string>
55
- <string>Ubuntu-Karmic-9.10-server-amd64</string>
56
- <string>OSX-Snow-Leopard-10.6.3</string>
57
- </values>
58
- </axis>
59
- </axes>
60
- <builders>
61
- <hudson.tasks.Shell>
62
- <command>#!/bin/bash -lxe
63
- GEMSET=build-$BUILD_NUMBER-ruby-$RUBY_VERSION
64
- rvm $RUBY_VERSION
65
- rvm gemset create $GEMSET
66
- rvm gemset use $GEMSET
67
- gem install rake rake-compiler rspec
68
- rake gem
69
- gem install therubyracer-*.gem
70
- v8 --selftest
71
- </command>
72
- </hudson.tasks.Shell>
73
- </builders>
74
- <publishers/>
75
- <buildWrappers/>
76
- <runSequentially>false</runSequentially>
77
- </matrix-project>
@@ -1,25 +0,0 @@
1
- require File.dirname(__FILE__) + "/spec_helper"
2
-
3
- require "hudson/core_ext/hash"
4
-
5
- describe Hash do
6
- subject do
7
- {
8
- :simple => "simple",
9
- :under_score => "under_score",
10
- :"hyp-hen" => "hyphen",
11
- "str_under_score" => "str_under_score",
12
- "str-hyp-hen" => "str-hyp-hen"
13
- }
14
- end
15
-
16
- it do
17
- subject.with_clean_keys.should == {
18
- :simple => "simple",
19
- :under_score => "under_score",
20
- :hyp_hen => "hyphen",
21
- :str_under_score => "str_under_score",
22
- :str_hyp_hen => "str-hyp-hen"
23
- }
24
- end
25
- end
@@ -1,137 +0,0 @@
1
- require File.dirname(__FILE__) + "/spec_helper"
2
-
3
- describe Hudson::JobConfigBuilder do
4
- include ConfigFixtureLoaders
5
-
6
- describe "explicit steps to match a ruby job" do
7
- before do
8
- @config = Hudson::JobConfigBuilder.new(:rails) do |c|
9
- c.scm = "git://codebasehq.com/mocra/misc/mocra-web.git"
10
- c.steps = [
11
- [:build_shell_step, "step 1"],
12
- [:build_shell_step, "step 2"]
13
- ]
14
- end
15
- end
16
- it "builds config.xml" do
17
- steps = Hpricot.XML(@config.to_xml).search("command")
18
- steps.map(&:inner_text).should == ["step 1", "step 2"]
19
- end
20
- end
21
-
22
-
23
- describe "rails job; single axis" do
24
- before do
25
- @config = Hudson::JobConfigBuilder.new(:rails) do |c|
26
- c.scm = "git://codebasehq.com/mocra/misc/mocra-web.git"
27
- end
28
- end
29
- it "builds config.xml" do
30
- config_xml("rails", "single").should == @config.to_xml
31
- end
32
- end
33
-
34
-
35
-
36
- describe "many rubies" do
37
- before do
38
- @config = Hudson::JobConfigBuilder.new(:ruby) do |c|
39
- c.scm = "http://github.com/drnic/picasa_plucker.git"
40
- c.rubies = %w[1.8.7 1.9.2 rbx-head jruby]
41
- end
42
- end
43
- it "have have explicit rubies" do
44
- config_xml("ruby", "multi").should == @config.to_xml
45
- end
46
-
47
- it "and many labels/assigned_nodes" do
48
- @config.node_labels = %w[1.8.7 ubuntu]
49
- config_xml("ruby", "multi-ruby-multi-labels").should == @config.to_xml
50
- end
51
- end
52
-
53
- describe "assigned slave nodes for slave usage" do
54
- before do
55
- @config = Hudson::JobConfigBuilder.new(:rails) do |c|
56
- c.assigned_node = "my-slave"
57
- end
58
- end
59
- it "builds config.xml" do
60
- Hpricot.XML(@config.to_xml).search("assignedNode").size.should == 1
61
- Hpricot.XML(@config.to_xml).search("assignedNode").text.should == "my-slave"
62
- Hpricot.XML(@config.to_xml).search("canRoam").text.should == "false"
63
- end
64
- end
65
-
66
- describe "no specific slave nodes" do
67
- before do
68
- @config = Hudson::JobConfigBuilder.new(:rails) do |c|
69
- end
70
- end
71
- it "builds config.xml" do
72
- Hpricot.XML(@config.to_xml).search("assignedNode").size.should == 0
73
- end
74
- end
75
-
76
- describe "SCM behaviour" do
77
- describe "#public_scm = true => convert git@ into git:// until we have deploy keys" do
78
- before do
79
- @config = Hudson::JobConfigBuilder.new(:rails) do |c|
80
- c.scm = "git@codebasehq.com:mocra/misc/mocra-web.git"
81
- c.public_scm = true
82
- end
83
- end
84
- it "builds config.xml" do
85
- config_xml("rails", "single").should == @config.to_xml
86
- end
87
- end
88
-
89
- # <branches>
90
- # <hudson.plugins.git.BranchSpec>
91
- # <name>master</name>
92
- # </hudson.plugins.git.BranchSpec>
93
- # <hudson.plugins.git.BranchSpec>
94
- # <name>other</name>
95
- # </hudson.plugins.git.BranchSpec>
96
- # </branches>
97
- describe "#scm-branches - set branches" do
98
- before do
99
- @config = Hudson::JobConfigBuilder.new(:rails) do |c|
100
- c.scm = "git@codebasehq.com:mocra/misc/mocra-web.git"
101
- end
102
- end
103
- it "defaults to 'master'" do
104
- branch_names = Hpricot.XML(@config.to_xml).search("branches name")
105
- branch_names.size.should == 1
106
- branch_names.text.should == "master"
107
- branch_names.first.parent.name.should == "hudson.plugins.git.BranchSpec"
108
- end
109
- it "can have specific branches" do
110
- branches = @config.scm_branches = %w[master other branches]
111
- branch_names = Hpricot.XML(@config.to_xml).search("branches name")
112
- branch_names.size.should == 3
113
- branch_names.map(&:inner_text).should == branches
114
- end
115
- end
116
- end
117
-
118
- describe "setup ENV variables via envfile plugin" do
119
- before do
120
- @config = Hudson::JobConfigBuilder.new(:rails) do |c|
121
- c.scm = "git://codebasehq.com/mocra/misc/mocra-web.git"
122
- c.steps = []
123
- c.envfile = "/path/to/env/file"
124
- end
125
- end
126
- it "builds config.xml" do
127
- xml_bite = <<-XML.gsub(/^ /, '')
128
- <buildWrappers>
129
- <hudson.plugins.envfile.EnvFileBuildWrapper>
130
- <filePath>/path/to/env/file</filePath>
131
- </hudson.plugins.envfile.EnvFileBuildWrapper>
132
- </buildWrappers>
133
- XML
134
- Hpricot.XML(@config.to_xml).search("buildWrappers").to_s.should == xml_bite.strip
135
- end
136
- end
137
- end
@@ -1,15 +0,0 @@
1
- require "bundler"
2
- Bundler.setup
3
-
4
- $:.unshift(File.dirname(__FILE__) + '/../lib')
5
- require 'hudson'
6
- require 'hpricot'
7
-
8
- module ConfigFixtureLoaders
9
- def config_xml(name, variation = nil)
10
- name += ".#{variation}" if variation
11
- @@config_fixture_loaders ||= {}
12
- @@config_fixture_loaders[name] ||= File.read(File.dirname(__FILE__) + "/fixtures/#{name}.config.xml")
13
- @@config_fixture_loaders[name]
14
- end
15
- end