Class: Highway::Steps::Library::TestFlightStep

Inherits:
Step
  • Object
show all
Defined in:
lib/highway/steps/library/testflight.rb

Class Method Summary collapse

Methods inherited from Step

root_parameter

Class Method Details

.nameObject



16
17
18
# File 'lib/highway/steps/library/testflight.rb', line 16

def self.name
  "testflight"
end

.parametersObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/highway/steps/library/testflight.rb', line 20

def self.parameters
  [
    Parameters::Single.new(
      name: "apple_id",
      required: true,
      type: Types::String.new()
    ),
    Parameters::Single.new(
      name: "app_specific_password",
      required: false,
      type: Types::String.new()
    ),
    Parameters::Single.new(
      name: "password",
      required: false,
      type: Types::String.new()
    ),
    Parameters::Single.new(
      name: "session",
      required: false,
      type: Types::String.new()
    ),
    Parameters::Single.new(
      name: "skip_submission",
      required: false,
      default: true,
      type: Types::Bool.new()
    ),
    Parameters::Single.new(
      name: "skip_waiting_for_build_processing",
      required: false,
      default: true,
      type: Types::Bool.new()
    ),
    Parameters::Single.new(
      name: "team_name",
      required: false,
      type: Types::String.new()
    ),
    Parameters::Single.new(
      name: "username",
      required: true,
      type: Types::String.regex(/^\S+@\S+\.\S+$/)
    )
  ]
end

.run(parameters:, context:, report:) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/highway/steps/library/testflight.rb', line 67

def self.run(parameters:, context:, report:)

  password = parameters["password"]
  app_specific_password = parameters["app_specific_password"]
  session = parameters["session"]

  if password.nil? && app_specific_password.nil?
    context.interface.fatal!("You need to provide an account password or application specific password! Additionally if you have enabled two-step verification, you will need to provide generated session.")
  end

  username = parameters["username"]
  apple_id = parameters["apple_id"]
  team_name = parameters["team_name"]
  skip_submission = parameters["skip_submission"]
  skip_waiting_for_build_processing = parameters["skip_waiting_for_build_processing"]

  env = {
    "FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD" => app_specific_password,
    "FASTLANE_PASSWORD" => password,
    "FASTLANE_SESSION" => session
  }

  context.with_modified_env(env) {
    context.run_action("upload_to_testflight", options: {
      username: username,
      skip_submission: skip_submission,
      skip_waiting_for_build_processing: skip_waiting_for_build_processing,
      apple_id: apple_id,
      team_name: team_name
    })
  }
  
end