Sha256: a3ebf5378c1c3865b102115ee60c9a713ed65a6b1ced7791b60bae151c61657d

Contents?: true

Size: 580 Bytes

Versions: 6

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

module Buildkite
  module Builder
    module Commands
      class Preview < Abstract
        private

        self.description = 'Outputs the pipeline YAML.'

        def run
          unless pipeline
            raise 'You must specify a pipeline'
          end

          puts Runner.new(pipeline: pipeline).run.to_yaml
        end

        def pipeline
          @pipeline ||= ARGV.last || begin
            if available_pipelines.one?
              available_pipelines.first
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
buildkite-builder-1.0.0 lib/buildkite/builder/commands/preview.rb
buildkite-builder-1.0.0.beta.5 lib/buildkite/builder/commands/preview.rb
buildkite-builder-1.0.0.beta.4 lib/buildkite/builder/commands/preview.rb
buildkite-builder-1.0.0.beta.3 lib/buildkite/builder/commands/preview.rb
buildkite-builder-1.0.0.beta.2 lib/buildkite/builder/commands/preview.rb
buildkite-builder-1.0.0.beta.1 lib/buildkite/builder/commands/preview.rb