Class: JenkinsController
- Inherits:
-
Object
- Object
- JenkinsController
- Defined in:
- lib/jenkins_controller.rb
Class Method Summary collapse
- .add_node(jenkins_url, user, password, name, ssh_user, mode, slave_url, v) ⇒ Object
- .build_details(jenkins_url, user, password, job, num) ⇒ Object
- .build_history(jenkins_url, user, password, job, limit) ⇒ Object
- .disable_email(jenkins_url, user, password, projects) ⇒ Object
- .enable_email(jenkins_url, user, password, projects, emails) ⇒ Object
- .grant_access(jenkins_url, user, password, grant_user) ⇒ Object
- .job_details(jenkins_url, user, password, job) ⇒ Object
- .job_labels(jenkins_url, user, password, job, labels) ⇒ Object
- .list_failures(jenkins_url, user, password) ⇒ Object
- .list_jobs(jenkins_url, user, password) ⇒ Object
- .log(jenkins_url, user, password, job) ⇒ Object
- .queue(jenkins_url, user, password) ⇒ Object
- .start_job(jenkins_url, user, password, job) ⇒ Object
Class Method Details
.add_node(jenkins_url, user, password, name, ssh_user, mode, slave_url, v) ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/jenkins_controller.rb', line 99 def self.add_node(jenkins_url, user, password, name, ssh_user, mode, slave_url, v) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? name = "--name #{name}" unless name.nil? ssh_user = "--ssh-user #{ssh_user}" unless ssh_user.nil? mode = "--mode #{mode}" unless mode.nil? slave_url = "--slave-url #{slave_url}" unless slave_url.nil? v = "--v #{v}" unless v.nil? system "#{File.dirname(__FILE__)}/add_executor.rb #{jenkins_url} #{user} #{password} #{name} #{ssh_user} #{mode} #{slave_url} #{v}" end |
.build_details(jenkins_url, user, password, job, num) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/jenkins_controller.rb', line 11 def self.build_details(jenkins_url, user, password, job, num) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? job = "--job #{job}" unless job.nil? build_number = "--build-number #{num}" unless num.nil? system "#{File.dirname(__FILE__)}/build_details.rb #{jenkins_url} #{user} #{password} #{job} #{build_number}" end |
.build_history(jenkins_url, user, password, job, limit) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/jenkins_controller.rb', line 2 def self.build_history(jenkins_url, user, password, job, limit) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? job = "--job #{job}" unless job.nil? limit = "--limit #{limit}" unless limit.nil? system "#{File.dirname(__FILE__)}/build_history.rb #{jenkins_url} #{user} #{password} #{job} #{limit}" end |
.disable_email(jenkins_url, user, password, projects) ⇒ Object
82 83 84 85 86 87 88 |
# File 'lib/jenkins_controller.rb', line 82 def self.disable_email(jenkins_url, user, password, projects) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? projects = "--projects '#{projects}'" unless projects.nil? system "#{File.dirname(__FILE__)}/disable_emails.rb #{jenkins_url} #{user} #{password} #{projects}" end |
.enable_email(jenkins_url, user, password, projects, emails) ⇒ Object
90 91 92 93 94 95 96 97 |
# File 'lib/jenkins_controller.rb', line 90 def self.enable_email(jenkins_url, user, password, projects, emails) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? projects = "--projects '#{projects}'" unless projects.nil? emails = "--emails '#{emails}'" unless emails.nil? system "#{File.dirname(__FILE__)}/enable_emails.rb #{jenkins_url} #{user} #{password} #{projects} #{emails}" end |
.grant_access(jenkins_url, user, password, grant_user) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/jenkins_controller.rb', line 28 def self.grant_access(jenkins_url, user, password, grant_user) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? grant_user = "--grant-user #{grant_user}" unless grant_user.nil? system "#{File.dirname(__FILE__)}/grant_user.rb #{jenkins_url} #{user} #{password} #{grant_user}" end |
.job_details(jenkins_url, user, password, job) ⇒ Object
52 53 54 55 56 57 58 |
# File 'lib/jenkins_controller.rb', line 52 def self.job_details(jenkins_url, user, password, job) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? job = "--job #{job}" unless job.nil? system "#{File.dirname(__FILE__)}/job_details.rb #{jenkins_url} #{user} #{password} #{job}" end |
.job_labels(jenkins_url, user, password, job, labels) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/jenkins_controller.rb', line 36 def self.job_labels(jenkins_url, user, password, job, labels) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? job = "--job #{job}" unless job.nil? labels = "--labels '#{labels}'" unless labels.nil? system "#{File.dirname(__FILE__)}/job_labels.rb #{jenkins_url} #{user} #{password} #{job} #{labels}" end |
.list_failures(jenkins_url, user, password) ⇒ Object
60 61 62 63 64 65 |
# File 'lib/jenkins_controller.rb', line 60 def self.list_failures(jenkins_url, user, password) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? system "#{File.dirname(__FILE__)}/list_failing_jobs.rb #{jenkins_url} #{user} #{password}" end |
.list_jobs(jenkins_url, user, password) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/jenkins_controller.rb', line 75 def self.list_jobs(jenkins_url, user, password) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? system "#{File.dirname(__FILE__)}/list_jobs.rb #{jenkins_url} #{user} #{password}" end |
.log(jenkins_url, user, password, job) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/jenkins_controller.rb', line 20 def self.log(jenkins_url, user, password, job) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? job = "--job #{job}" unless job.nil? system "#{File.dirname(__FILE__)}/stream_log.rb #{jenkins_url} #{user} #{password} #{job}" end |
.queue(jenkins_url, user, password) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/jenkins_controller.rb', line 45 def self.queue(jenkins_url, user, password) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? system "#{File.dirname(__FILE__)}/display_queue.rb #{jenkins_url} #{user} #{password}" end |
.start_job(jenkins_url, user, password, job) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/jenkins_controller.rb', line 67 def self.start_job(jenkins_url, user, password, job) jenkins_url = "--jenkins-url #{jenkins_url}" unless jenkins_url.nil? user = "--user #{user}" unless user.nil? password = "--password #{password}" unless password.nil? job = "--job #{job}" unless job.nil? system "#{File.dirname(__FILE__)}/start_job.rb #{jenkins_url} #{user} #{password} #{job}" end |