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



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

def self.authors
  ['Automattic']
end

.available_optionsObject



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

def self.available_options
  []
end

.descriptionObject



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

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

.detailsObject



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

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.is_supported?(platform)
  true
end

.return_valueObject



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

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

.run(params = {}) ⇒ Object



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

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



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

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.



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

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