class Fastlane::Helper::RollbarHelper

Public Class Methods

create_bundle(os) click to toggle source

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

# File lib/fastlane/plugin/rollbar/helper/rollbar_helper.rb, line 18
def self.create_bundle(os)
  UI.message('Creating React Native bundle')
  jsbundle = os == 'ios' ? 'main.jsbundle' : 'index.android.bundle'
  assets_dest = os == 'ios' ? 'ios' : 'android/app/src/main/res/'
  Action.sh("react-native bundle \
    --platform #{os} \
    --dev false \
    --entry-file index.js \
    --bundle-output /tmp/#{jsbundle} \
    --assets-dest #{assets_dest} \
    --sourcemap-output /tmp/sourcemap.#{os}.js \
    --sourcemap-sources-root ./")
end
report_deploy(api_key, environment, revision, local_username, rollbar_username, comment, status) click to toggle source
# File lib/fastlane/plugin/rollbar/helper/rollbar_helper.rb, line 63
def self.report_deploy(api_key, environment, revision, local_username, rollbar_username, comment, status)
  UI.message('Report deploy to Rollbar')
  action_params = ["curl #{API_DEPLOY_URL} -F access_token=#{api_key} -F environment=#{environment} -F revision=#{revision}"]
  if local_username
    action_params.push("-F local_username=#{local_username}")
  end
  if rollbar_username
    action_params.push("-F rollbar_username=#{rollbar_username}")
  end
  if comment
    action_params.push("-F comment=#{comment}")
  end
  if status
    action_params.push("-F status=#{status}")
  end
  Action.sh(action_params.join(" "))
end
show_message() click to toggle source
# File lib/fastlane/plugin/rollbar/helper/rollbar_helper.rb, line 81
def self.show_message
  UI.message('Hello from the rollbar plugin helper!')
end
upload_bundle(api_key, os, code_version, environment) click to toggle source
# File lib/fastlane/plugin/rollbar/helper/rollbar_helper.rb, line 32
def self.upload_bundle(api_key, os, code_version, environment)
  UI.message('Uploading React Native bundle to Rollbar')
  jsbundle = os == 'ios' ? 'main.jsbundle' : 'index.android.bundle'
  Action.sh("curl #{API_SOURCEMAP_URL} \
    -F access_token=#{api_key} \
    -F version=#{code_version}.#{os} \
    -F minified_url=http://reactnativehost/#{jsbundle} \
    -F environment=#{environment} \
    -F source_map=@/tmp/sourcemap.#{os}.js \
    -F index.js=@index.js")
end
upload_dsym(api_key, dsym_path, code_version, bundle_identifier, environment) click to toggle source
# File lib/fastlane/plugin/rollbar/helper/rollbar_helper.rb, line 44
def self.upload_dsym(api_key, dsym_path, code_version, bundle_identifier, environment)
  UI.message('Uploading Dsym to Rollbar')
  Action.sh("curl -X POST #{API_DSYM_URL} \
    -F access_token=#{api_key} \
    -F version=#{code_version}.ios \
    -F bundle_identifier=#{bundle_identifier} \
    -F environment=#{environment} \
    -F dsym=@#{dsym_path}")
end
upload_proguard(api_key, proguard_path, code_version, environment) click to toggle source
# File lib/fastlane/plugin/rollbar/helper/rollbar_helper.rb, line 54
def self.upload_proguard(api_key, proguard_path, code_version, environment)
  UI.message('Uploading Proguard mapping to Rollbar')
  Action.sh("curl #{API_PROGUARD_URL} \
    -F access_token=#{api_key} \
    -F version=#{code_version}.android \
    -F environment=#{environment} \
    -F mapping=@#{proguard_path}")
end