Class: Fastlane::Actions::CodepushRenameDeploymentAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



26
27
28
# File 'lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb', line 26

def self.authors
  ['Pranit Harekar']
end

.available_optionsObject



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
66
67
68
69
70
71
# File 'lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb', line 36

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :app_name,
        env_name: "APP_CENTER_APP_NAME",
        description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
        optional: false,
        type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :execution_dir_path,
      description: 'Release React CLI command execution dir path',
      optional: true,
      type: String,
      default_value: "./"
    ),
    FastlaneCore::ConfigItem.new(
      key: :deployment_name,
      description: 'Deployment name',
      optional: false,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :new_deployment_name,
      description: 'New deployment name',
      optional: false,
      type: String
    ),
    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



22
23
24
# File 'lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb', line 22

def self.description
  'CodePush rename deployment action'
end

.detailsObject



33
34
# File 'lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb', line 33

def self.details
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb', line 73

def self.is_supported?(platform)
  true
end

.return_valueObject



30
31
# File 'lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb', line 30

def self.return_value
end

.run(params) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb', line 6

def self.run(params)
  Dir.chdir(params[:execution_dir_path].to_s) do
    command = "appcenter codepush deployment rename "
    ## params
    command += "-a #{params[:app_name]} "
    command += "#{params[:deployment_name]} "
    command += (params[:new_deployment_name]).to_s

    if params[:dry_run]
      UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
    else
      sh(command.to_s)
    end
  end
end