Class: JenkinsPipelineBuilder::RemoteDependencies
- Inherits:
-
Object
- Object
- JenkinsPipelineBuilder::RemoteDependencies
- Defined in:
- lib/jenkins_pipeline_builder/remote_dependencies.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#job_collection ⇒ Object
readonly
Returns the value of attribute job_collection.
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize(job_collection) ⇒ RemoteDependencies
constructor
A new instance of RemoteDependencies.
- #load(dependencies) ⇒ Object
- #logger ⇒ Object
Constructor Details
#initialize(job_collection) ⇒ RemoteDependencies
Returns a new instance of RemoteDependencies.
5 6 7 8 |
# File 'lib/jenkins_pipeline_builder/remote_dependencies.rb', line 5 def initialize(job_collection) @entries = {} @job_collection = job_collection end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
3 4 5 |
# File 'lib/jenkins_pipeline_builder/remote_dependencies.rb', line 3 def entries @entries end |
#job_collection ⇒ Object (readonly)
Returns the value of attribute job_collection.
3 4 5 |
# File 'lib/jenkins_pipeline_builder/remote_dependencies.rb', line 3 def job_collection @job_collection end |
Instance Method Details
#cleanup ⇒ Object
14 15 16 17 18 19 |
# File 'lib/jenkins_pipeline_builder/remote_dependencies.rb', line 14 def cleanup entries.each_value do |file| FileUtils.rm_r file FileUtils.rm_r "#{file}.tar" end end |
#load(dependencies) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/jenkins_pipeline_builder/remote_dependencies.rb', line 21 def load(dependencies) dependencies.each do |source| source = source[:source] url = source[:url] file = "remote-#{entries.length}" if entries[url] file = entries[url] else opts = {} opts = { ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE } if source[:verify_ssl] == false download_yaml(url, file, opts) end path = File.(file, Dir.getwd) return load_default_path path unless source[:templates] load_templates(path, source[:templates]) end end |
#logger ⇒ Object
10 11 12 |
# File 'lib/jenkins_pipeline_builder/remote_dependencies.rb', line 10 def logger JenkinsPipelineBuilder.logger end |