Sha256: 5da48219242862042b22c45673a5bfadfad6730af3be05cde04fd198aa947fe4

Contents?: true

Size: 811 Bytes

Versions: 2

Compression:

Stored size: 811 Bytes

Contents

require_relative 'deploygate_client'

module Danger
  class DangerDeploygate < Plugin

    #
    # Uploading user or group name
    #
    # @return   [String]
    #
    attr_accessor :user

    #
    # API Token
    #
    # @return   [String]
    #
    attr_writer :token

    def token
      @token ||= ENV['DEPLOYGATE_API_TOKEN']
    end

    def upload(binary, filename, message = nil, distribution_name = nil)
      client = DeployGate::Client.new(user, token)
      response = client.upload(binary, filename, message, distribution_name)

      app_name = response['results']['name']
      revision = "##{response['results']['revision']}"
      url = "https://deploygate.com#{response['results']['path']}"

      message "DeployGate Uploaded #{app_name} #{revision}, see detail: #{url}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
danger-deploygate-0.0.4 lib/deploygate/plugin.rb
danger-deploygate-0.0.2 lib/deploygate/plugin.rb