Sha256: 04034fe066755c46b6a2b972836fdd53762bdceed7c0928585961387031d1618

Contents?: true

Size: 969 Bytes

Versions: 7

Compression:

Stored size: 969 Bytes

Contents

#!/usr/bin/env ruby

require 'concourse-fuselage'
require 'contracts'
require_relative 'core'
require_relative 'support/params'
require_relative 'support/git'
require_relative 'support/github'

module GitHubStatus
  class Out < Fuselage::Out
    include Core
    include Support::Params
    include Support::Git
    include Support::GitHub

    Contract None => Sawyer::Resource
    def update!
      github.create_status repo, sha, state, options
    rescue Octokit::Error => error
      STDERR.puts error.message
      abort
    end

    Contract None => HashOf[String, String]
    def version
      { 'context@sha' => "#{context}@#{sha}" }
    end

    Contract None => String
    def target_url
      @target_url ||= "#{atc_external_url}/builds/#{build_id}"
    end

    Contract None => HashOf[Symbol, String]
    def options
      @options ||= {
        context: context,
        target_url: target_url,
        description: description
      }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
concourse-github-status-0.4.3 lib/github-status/out.rb
concourse-github-status-0.4.2 lib/github-status/out.rb
concourse-github-status-0.4.1 lib/github-status/out.rb
concourse-github-status-0.4.0 lib/github-status/out.rb
concourse-github-status-0.3.1 lib/github-status/out.rb
concourse-github-status-0.3.0 lib/github-status/out.rb
concourse-github-status-0.2.4 lib/github-status/out.rb