Sha256: 64d5466155394547ef13e11f4672a5575df4f6c1b0994506b3c40a798c0ae760

Contents?: true

Size: 855 Bytes

Versions: 7

Compression:

Stored size: 855 Bytes

Contents

require 'faraday'
require 'json'

module Fastlane
  module Shuttle
    class Client
      def initialize(base_url, access_token)
        retry_options = {
          max: 2,
          interval: 0.05,
          interval_randomness: 0.5,
          backoff_factor: 2
        }

        @conn = Faraday.new(
          url: base_url,
          headers: {
            'Content-Type' => 'application/json',
            'Access-Token' => access_token
          }
        ) do |conn|
          conn.request :retry, retry_options
          conn.request :multipart

          conn.response :raise_error

          conn.adapter :net_http
        end
      end

      def create_build(platform, app_identifier, build)
        @conn.post(
          "cd/apps/#{platform}/#{app_identifier}/builds",
          { build: build }.to_json
        )
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fastlane-plugin-polidea-3.0.1 lib/fastlane/plugin/polidea/helper/shuttle.rb
fastlane-plugin-polidea-3.0.0 lib/fastlane/plugin/polidea/helper/shuttle.rb
fastlane-plugin-polidea-3.0.0.pre.2 lib/fastlane/plugin/polidea/helper/shuttle.rb
fastlane-plugin-polidea-3.0.0.pre.1 lib/fastlane/plugin/polidea/helper/shuttle.rb
fastlane-plugin-polidea-2.2.0.pre.1 lib/fastlane/plugin/polidea/helper/shuttle.rb
fastlane-plugin-polidea-2.2.0.pre lib/fastlane/plugin/polidea/helper/shuttle.rb
fastlane-plugin-polidea-2.1.1.pre.2 lib/fastlane/plugin/polidea/helper/shuttle.rb