class Fastlane::Actions::PixieAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/pixie/actions/pixie_action.rb, line 27
def self.authors
  ["Piotrek Dubiel"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/pixie/actions/pixie_action.rb, line 31
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :device_id,
                            env_name: "PIXIE_DEVICE_ID",
                         description: "Device id of your Particle Photon/Core",
                            optional: false,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :access_token,
                            env_name: "PIXIE_ACCESS_TOKEN",
                         description: "Access token to Particle Cloud",
                            optional: false,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :status,
                            env_name: "PIXIE_STATUS",
                         description: "Build status to send",
                            optional: true,
                                type: String,
                       default_value: "success"),
    FastlaneCore::ConfigItem.new(key: :port,
                            env_name: "PIXIE_PORT",
                         description: "Port number",
                                type: String)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/pixie/actions/pixie_action.rb, line 23
def self.description
  "Show your build status on PIXIE!"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/pixie/actions/pixie_action.rb, line 56
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File lib/fastlane/plugin/pixie/actions/pixie_action.rb, line 9
def self.run(params)
  res = Particle.new(params[:access_token], params[:device_id]).function("statusPort#{params[:port]}", params[:status])
  if res.kind_of?(Net::HTTPSuccess)
    UI.success("PIXIE status set!")
  else
    UI.error("Error: #{res.body}")
  end
  sleep 1
end
unique_id_from_git_remote_origin() click to toggle source
# File lib/fastlane/plugin/pixie/actions/pixie_action.rb, line 19
def self.unique_id_from_git_remote_origin
  Digest::MD5.hexdigest sh "git config --get remote.origin.url"
end