Class: Fastlane::Actions::CodePushPromoteAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



17
18
19
# File 'lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb', line 17

def self.authors
  ["Manuel Koch"]
end

.available_optionsObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb', line 28

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :app_name,
                                env_name: "FASTLANE_CODE_PUSH_APP_NAME",
                                type: String,
                                optional: false,
                                description: "CodePush app name for promoting to"),
    FastlaneCore::ConfigItem.new(key: :from,
                                type: String,
                                optional: true,
                                default_value: "Staging",
                                description: "sourceDeploymentName"),
    FastlaneCore::ConfigItem.new(key: :to,
                                 type: String,
                                 optional: true,
                                 default_value: "Production",
                                 description: "destDeploymentName"),
    FastlaneCore::ConfigItem.new(key: :dry_run,
                                 description: "Print the command that would be run, and don't run it",
                                 is_string: false,
                                 default_value: false)
  ]
end

.descriptionObject



13
14
15
# File 'lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb', line 13

def self.description
  "CodePush promote"
end

.detailsObject



24
25
26
# File 'lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb', line 24

def self.details
  "CodePush promote functionality"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb', line 52

def self.is_supported?(platform)
  true
end

.return_valueObject



21
22
# File 'lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb', line 21

def self.return_value
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb', line 4

def self.run(params)
  command = "code-push promote #{params[:app_name]} #{params[:from]} #{params[:to]}"
  if params[:dry_run]
    UI.message("Dry run!".red + " Would have run: " + command + "\n")
  else
    sh(command.to_s)
  end
end