class Fastlane::Helper::AppliveryHelper

Public Class Methods

add_git_remote() click to toggle source
# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 58
def self.add_git_remote
  return `git config --get remote.origin.url`
rescue
  return ""
end
get_integration_number() click to toggle source
# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 20
def self.get_integration_number
  xcodeIntegrationNumber = ENV["XCS_INTEGRATION_NUMBER"] # XCode Server
  jenkinsIntegrationNumber = ENV["BUILD_NUMBER"] # Jenkins
  travisIntegrationNumber = ENV["TRAVIS_BUILD_NUMBER"] # Travis
  integrationNumber = ""
  
  if !xcodeIntegrationNumber.nil?
    integrationNumber += xcodeIntegrationNumber
  elsif !jenkinsIntegrationNumber.nil?
    integrationNumber += jenkinsIntegrationNumber
  elsif !travisIntegrationNumber.nil?
    integrationNumber += travisIntegrationNumber
  end

  return integrationNumber
end
git_branch() click to toggle source

GIT Methods ###

# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 40
def self.git_branch
  return Actions.git_branch
rescue
  return ""
end
git_commit() click to toggle source
# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 46
def self.git_commit
  return `git rev-parse --short HEAD`
rescue
  return ""
end
git_message() click to toggle source
# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 52
def self.git_message
  return Actions.last_git_commit_message
rescue
  return ""
end
git_tag() click to toggle source
# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 64
def self.git_tag
  gitTag = `git describe --abbrev=0 --tags`
  gitTagCommit = `git rev-list -n 1 --abbrev-commit #{gitTag}`
  gitCommit = `git rev-parse --short HEAD`
  return gitTag if gitTagCommit == gitCommit
  return ""
rescue
  return ""
end
parse_error(error) click to toggle source
# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 74
def self.parse_error(error)
  if error
    case error["code"]
    when 5006
      UI.user_error! "Upload fail. The build path seems to be wrong or file is invalid"
    when 4004
      UI.user_error! "The app_token is not valid. Please, go to your app settings and doble-check the integration tokens"
    when 4002
      UI.user_error! "The app_token is empty. Please, go to your app Settings->Integrations to generate a token"
    else
      UI.user_error! "Upload fail. [#{error["code"]}]: #{error["message"]}"
    end
  else
    UI.crash! "Upload fails unexpectedly. [#{response.status}]"
  end
end
platform() click to toggle source
# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 11
def self.platform
  platform = Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]
  if platform == :ios or platform.nil?
    return "ios"
  elsif platform == :android
    return "android"
  end
end
show_message() click to toggle source

class methods that you define here become available in your action as `Helper::AppliveryHelper.your_method`

# File lib/fastlane/plugin/applivery/helper/applivery_helper.rb, line 7
def self.show_message
  UI.message("Hello from the applivery plugin helper!")
end