Top Level Namespace
Constant Summary collapse
- URL =
'http://jenkins.ng.com:8080'
- AUTH =
["neurogeek", "123qwe4r!!"]
- JENK =
AutoJenkins::Jenkins.new(URL, AUTH)
Instance Method Summary collapse
- #CreateFromJob(jobname, newjobname) ⇒ Object
- #GetBuildInfo(jobname, buildnum) ⇒ Object
- #GetConfig(jobname) ⇒ Object
- #GetInfo(jobname) ⇒ Object
- #GetJob(jobname) ⇒ Object
- #ListAll ⇒ Object
- #pretty_print(entry, tab = 1) ⇒ Object
Instance Method Details
#CreateFromJob(jobname, newjobname) ⇒ Object
27 28 29 30 31 |
# File 'lib/test.rb', line 27 def CreateFromJob(jobname, newjobname) job = JENK.get_job(jobname) job2 = job.copy(newjobname) print "#{job2.name}\n" end |
#GetBuildInfo(jobname, buildnum) ⇒ Object
33 34 35 36 37 |
# File 'lib/test.rb', line 33 def GetBuildInfo(jobname, buildnum) job = JENK.get_job(jobname) bld = job.get_build(buildnum) return bld end |
#GetConfig(jobname) ⇒ Object
39 40 41 42 |
# File 'lib/test.rb', line 39 def GetConfig(jobname) job = JENK.get_job(jobname) return job.get_config() end |
#GetInfo(jobname) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/test.rb', line 48 def GetInfo(jobname) def pretty_print(entry, tab=1) if entry.kind_of? Hash entry.keys.each do |k| print " " * tab * 2 print "#{k} ----> \n" pretty_print(entry[k], tab=tab+1) end elsif entry == nil print " " * tab * 2 print "[NONE]\n" elsif entry.kind_of? Array entry.each do |v| pretty_print(v, tab+1) end else print "\t" * tab print "#{entry}\n" end end job = JENK.get_job(jobname) job.info.keys.each do |k| print "#{k} ----> \n" pretty_print job.info[k] end end |
#GetJob(jobname) ⇒ Object
44 45 46 |
# File 'lib/test.rb', line 44 def GetJob(jobname) return JENK.get_job(jobname) end |
#ListAll ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/test.rb', line 14 def ListAll() jobs = JENK.all_jobs() if jobs jobs.each do |jb| print "#{jb.name} --> #{jb.get_url}\n" print "DisplayName: #{jb.get_displayName}\n" jb.info_items.each do |i| puts i end end end end |
#pretty_print(entry, tab = 1) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/test.rb', line 49 def pretty_print(entry, tab=1) if entry.kind_of? Hash entry.keys.each do |k| print " " * tab * 2 print "#{k} ----> \n" pretty_print(entry[k], tab=tab+1) end elsif entry == nil print " " * tab * 2 print "[NONE]\n" elsif entry.kind_of? Array entry.each do |v| pretty_print(v, tab+1) end else print "\t" * tab print "#{entry}\n" end end |