Sha256: 1ee45747ef6a55ba7d939e89c71598556edb37f09084821318e11f0fd7c89aa7

Contents?: true

Size: 713 Bytes

Versions: 4

Compression:

Stored size: 713 Bytes

Contents

module JenkinsPipelineBuilder
  class Project
    attr_reader :input
    attr_accessor :errors
    def initialize(name, input)
      @name = name
      @input = input
      @errors = {}
    end

    def publish
      success, payload = resolve_project(input)
      return { project_name: 'Failed to resolve' } unless success

      logger.info 'successfully resolved project'
      compiled_project = payload

      self.errors = publish_jobs(compiled_project[:value][:jobs]) if compiled_project[:value][:jobs]
      return unless compiled_project[:value][:views]
      compiled_project[:value][:views].each do |v|
        compiled_view = v[:result]
        view.create(compiled_view)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jenkins_pipeline_builder-0.15.3 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.15.2 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.15.1 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.14.0 lib/jenkins_pipeline_builder/project.rb