Sha256: bfca6a31c7294d7f2c31db48b43dbed038f15312babc8d219548b9a58a61995d

Contents?: true

Size: 741 Bytes

Versions: 12

Compression:

Stored size: 741 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)
      if success
        logger.info 'successfully resolved project'
        compiled_project = payload
      else
        return { project_name: 'Failed to resolve' }
      end

      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

12 entries across 12 versions & 1 rubygems

Version Path
jenkins_pipeline_builder-0.13.4 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.13.3 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.13.2 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.13.1 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.13.0 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.12.3 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.12.2 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.12.1 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.12.0 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.11.2 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.11.1 lib/jenkins_pipeline_builder/project.rb
jenkins_pipeline_builder-0.11.0 lib/jenkins_pipeline_builder/project.rb