Class: Fastlane::Actions::ConfigureSetupAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ConfigureSetupAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .configuration_file_exists ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .prompt_to_update_to_most_recent_version ⇒ Object
- .repository_path ⇒ Object
- .return_value ⇒ Object
- .run(params = {}) ⇒ Object
-
.update_branch ⇒ Object
Ensure that the local secrets respository is up to date.
Class Method Details
.authors ⇒ Object
65 66 67 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 65 def self. ['Automattic'] end |
.available_options ⇒ Object
77 78 79 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 77 def self. [] end |
.configuration_file_exists ⇒ Object
53 54 55 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 53 def self.configuration_file_exists Fastlane::Helper::ConfigureHelper.configuration_path_exists end |
.description ⇒ Object
61 62 63 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 61 def self.description 'Set up the .configure file' end |
.details ⇒ Object
73 74 75 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 73 def self.details 'Interactively walks the user through setting up the `.configure` file. Assumes the ~/.mobile-secrets directory exists' end |
.is_supported?(platform) ⇒ Boolean
81 82 83 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 81 def self.is_supported?(platform) true end |
.prompt_to_update_to_most_recent_version ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 40 def self.prompt_to_update_to_most_recent_version if UI.confirm("The current branch is #{Fastlane::Helper::ConfigureHelper.repo_commits_behind_remote} commit(s) behind. It must be updated to complete the setup. Would you like to continue?") update_branch else UI.user_error!('Cannot complete setup when the repo is not up to date.') end end |
.repository_path ⇒ Object
57 58 59 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 57 def self.repository_path Fastlane::Helper::FilesystemHelper.secret_store_dir end |
.return_value ⇒ Object
69 70 71 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 69 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 12 def self.run(params = {}) # Check to see if the local secret storage is set up at ~/.mobile-secrets. UI.user_error!('The local secrets store does not exist. Please clone it to ~/.mobile-secrets before continuing.') unless File.directory?(repository_path) # Checks to see if .configure exists. If so, exit – there’s no need to continue as everything is set up. if configuration_file_exists UI.success 'Configure file exists – exiting.' return end # The mobile secrets repo must be up to date in order to generate and save the encryption key prompt_to_update_to_most_recent_version if Fastlane::Helper::ConfigureHelper.repo_is_behind_remote # Generate an encryption key for the new project, if needed Fastlane::Helper::ConfigureHelper.update_project_encryption_key if Fastlane::Helper::ConfigureHelper.project_encryption_key.nil? # Write out the `.configure` file. Fastlane::Helper::ConfigureHelper.update_configure_file_from_repository # Walk the user through adding files to copy to the `.configure` file. ConfigureAddFilesToCopyAction.run # Copy the files we just walked the user through setting up. ConfigureApplyAction.run UI.success 'Created .configure file' end |
.update_branch ⇒ Object
Ensure that the local secrets respository is up to date
49 50 51 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_setup_action.rb', line 49 def self.update_branch sh("cd '#{Fastlane::Helper::FilesystemHelper.secret_store_dir}' && git pull") end |