Class: Fastlane::Actions::ConfigureDownloadAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



35
36
37
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 35

def self.authors
  ['Automattic']
end

.available_optionsObject



47
48
49
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 47

def self.available_options
  []
end

.descriptionObject



31
32
33
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 31

def self.description
  'Updates the mobile secrets.'
end

.detailsObject



43
44
45
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 43

def self.details
  'Pulls down the latest remote changes to the ~/.mobile-secrets repository.'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 51

def self.is_supported?(platform)
  true
end

.return_valueObject



39
40
41
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 39

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

.run(params = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 8

def self.run(params = {})
  UI.message 'Running Configure Download'

  # If the `~/.mobile-secrets` repository doesn't exist
  if File.directory?(secrets_dir)
    update_repository # If the repo already exists, just update it
  else
    UI.user_error!("The local secrets store does not exist. Please clone it to #{secrets_dir} before continuing.")
  end
end

.secrets_dirObject



27
28
29
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 27

def self.secrets_dir
  Fastlane::Helper::FilesystemHelper.secret_store_dir
end

.update_repositoryObject

Ensure the git repository at ‘~/.mobile-secrets` is up to date. If the secrets repo is in a detached HEAD state, skip the pull, since it will fail.



21
22
23
24
25
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_download_action.rb', line 21

def self.update_repository
  secrets_repo_branch = Fastlane::Helper::ConfigureHelper.repo_branch_name

  sh("cd #{secrets_dir} && git pull") unless secrets_repo_branch.nil?
end