Class: Fastlane::Actions::PixieAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::PixieAction
- Defined in:
- lib/fastlane/plugin/pixie/actions/pixie_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
- .unique_id_from_git_remote_origin ⇒ Object
Class Method Details
.authors ⇒ Object
27 28 29 |
# File 'lib/fastlane/plugin/pixie/actions/pixie_action.rb', line 27 def self. ["Piotrek Dubiel"] end |
.available_options ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/fastlane/plugin/pixie/actions/pixie_action.rb', line 31 def self. [ 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 ⇒ Object
23 24 25 |
# File 'lib/fastlane/plugin/pixie/actions/pixie_action.rb', line 23 def self.description "Show your build status on PIXIE!" end |
.is_supported?(platform) ⇒ Boolean
56 57 58 |
# File 'lib/fastlane/plugin/pixie/actions/pixie_action.rb', line 56 def self.is_supported?(platform) true end |
.run(params) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# 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 ⇒ Object
19 20 21 |
# 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 |