Sha256: 50a757b84b376e394fff19b905a976f3394668c35473e2934af287e06be4187e

Contents?: true

Size: 985 Bytes

Versions: 7

Compression:

Stored size: 985 Bytes

Contents

# frozen_string_literal: true

module Buildkite
  module Builder
    module Commands
      class Run < Abstract
        private
        include LoggingUtils
        using Rainbow

        self.description = 'Builds and uploads the generated pipeline.'

        def run
          relative_pipeline_path = pipeline_path.relative_path_from(Builder.root)

          # This entrypoint is for running on CI. It expects certain environment
          # variables to be set. It also uploads the pipeline to Buildkite.
          log.info "+++ 🧰 #{'Buildkite Builder'.color(:springgreen)} v#{Buildkite::Builder.version} ─ #{relative_pipeline_path.to_s.yellow}"

          if Buildkite::Pipelines::Command.meta_data(:exists, Builder.meta_data.fetch(:job)).success?
            log.info "Pipeline already uploaded in #{Buildkite.env.step_id} step".color(:dimgray)
          else
            Pipeline.new(pipeline_path, logger: log).upload
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
buildkite-builder-4.15.0 lib/buildkite/builder/commands/run.rb
buildkite-builder-4.14.0 lib/buildkite/builder/commands/run.rb
buildkite-builder-4.13.0 lib/buildkite/builder/commands/run.rb
buildkite-builder-4.12.0 lib/buildkite/builder/commands/run.rb
buildkite-builder-4.11.0 lib/buildkite/builder/commands/run.rb
buildkite-builder-4.10.0 lib/buildkite/builder/commands/run.rb
buildkite-builder-4.8.0 lib/buildkite/builder/commands/run.rb