Class: ForemanPipeline::JenkinsInstance
- Inherits:
-
Katello::Model
- Object
- Katello::Model
- ForemanPipeline::JenkinsInstance
- Includes:
- Authorization::JenkinsInstance, Katello::Glue
- Defined in:
- app/models/foreman_pipeline/jenkins_instance.rb
Constant Summary collapse
- FILEPATH_REGEX =
/\A(\/|~)[a-z0-9\-_.\/]*[^\/]\z/i
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#server_version ⇒ Object
Returns the value of attribute server_version.
Instance Method Summary collapse
-
#create_client(username = nil, password = nil) ⇒ Object
TODO: loose coupling.
- #timeout_sec ⇒ Object
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
7 8 9 |
# File 'app/models/foreman_pipeline/jenkins_instance.rb', line 7 def client @client end |
#server_version ⇒ Object
Returns the value of attribute server_version.
7 8 9 |
# File 'app/models/foreman_pipeline/jenkins_instance.rb', line 7 def server_version @server_version end |
Instance Method Details
#create_client(username = nil, password = nil) ⇒ Object
TODO: loose coupling
27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/models/foreman_pipeline/jenkins_instance.rb', line 27 def create_client(username = nil, password = nil) fail "Cannot create Jenkins client: no url in Jenkins Instance" if url.nil? fail "Token required if username given." if !username.nil? && password.nil? if !@client.nil? && @client.username.nil? && !username.nil? @client = new_client username, password else @client ||= new_client username, password end @client end |
#timeout_sec ⇒ Object
39 40 41 |
# File 'app/models/foreman_pipeline/jenkins_instance.rb', line 39 def timeout_sec timeout * 60 end |