Class: GitlabMobileReviewAppBuilder::Android

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_mobile_review_app_builder.rb

Class Method Summary collapse

Class Method Details

.delete_from_appetize!(options) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/gitlab_mobile_review_app_builder.rb', line 30

def self.delete_from_appetize!(options)
  token      = options[:token]    || ENV['APPETIZE_API_TOKEN']
  api_host   = options[:api_host] || 'api.appetize.io'

  response = HTTP.basic_auth(user: token, pass: '').delete("https://#{api_host}/v1/apps/#{options[:public_key]}")

  raise "Delete failed: #{response.status}" if response.status != 200
end

.deploy_to_appetize!(options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/gitlab_mobile_review_app_builder.rb', line 13

def self.deploy_to_appetize!(options)
  token      = options[:token]    || ENV['APPETIZE_API_TOKEN']
  path       = options[:path]     || 'app/build/outputs/apk/debug/app-debug.apk'
  api_host   = options[:api_host] || 'api.appetize.io'

  Fastlane::Actions::AppetizeAction.run(
    path: path,
    api_token: token,
    platform: 'android',
    api_host: api_host
  )

  public_key = Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APPETIZE_PUBLIC_KEY]

  File.write('./review.env', "APPETIZE_PUBLIC_KEY=#{public_key}")
end