Class: Fastlane::Actions::QueueAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/queue/actions/queue_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



34
35
36
# File 'lib/fastlane/plugin/queue/actions/queue_action.rb', line 34

def self.authors
  ["Josh Holtz"]
end

.available_optionsObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fastlane/plugin/queue/actions/queue_action.rb', line 46

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :run,
                         description: "Run that stuff",
                            optional: true,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :platform,
                         description: "Run that stuff",
                            optional: true,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :lane,
                         description: "Run that stuff",
                            optional: true,
                                type: String),
    FastlaneCore::ConfigItem.new(key: :lane_parameters,
                         description: "Run that stuff",
                            optional: true,
                                type: Hash)
  ]
end

.descriptionObject



30
31
32
# File 'lib/fastlane/plugin/queue/actions/queue_action.rb', line 30

def self.description
  "Adds fastlane jobs to a queue"
end

.detailsObject



42
43
44
# File 'lib/fastlane/plugin/queue/actions/queue_action.rb', line 42

def self.details
  "Adds fastlane jobs to a Resque queue"
end

.is_supported?(platform) ⇒ Boolean



67
68
69
# File 'lib/fastlane/plugin/queue/actions/queue_action.rb', line 67

def self.is_supported?(platform)
  true
end

.return_valueObject



38
39
40
# File 'lib/fastlane/plugin/queue/actions/queue_action.rb', line 38

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fastlane/plugin/queue/actions/queue_action.rb', line 6

def self.run(params)
  # Should be value like "<platform> <lane> <parameters...>"
  # Ex: "ios build environment:production"
  # Usage: fastlane run queue run:"ios build environment:production"
  run = params[:run]

  # These values come in from running the queue action in a Fastfile
  platform = params[:platform]
  lane = params[:lane]
  lane_parameters = params[:lane_parameters]

  if lane_parameters
    lane_parameters['queue'] = nil
    lane_parameters[:queue] = nil
  end

  Resque.enqueue(Job, {
    'run' => run,
    'platform' => platform,
    'lane' => lane,
    'lane_parameters' => lane_parameters
    })
end