Class: Fastlane::Actions::UpdateFixVersionAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::UpdateFixVersionAction
- Defined in:
- lib/fastlane/plugin/apadmi_grout/actions/update_fix_version_action.rb
Overview
Update the released status and/or description of a Jira version by name
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(_platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/apadmi_grout/actions/update_fix_version_action.rb', line 45 def self. ["samdc@apadmi.com"] end |
.available_options ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/fastlane/plugin/apadmi_grout/actions/update_fix_version_action.rb', line 49 def self. Apadmi::Grout::CommonOptions. + [ FastlaneCore::ConfigItem.new(key: :version_name, description: "The name of the Jira version to update", type: String, optional: false), FastlaneCore::ConfigItem.new(key: :released, description: "Whether to mark the version as released", type: Object, optional: true, default_value: nil), FastlaneCore::ConfigItem.new(key: :description, description: "The description to set on the version", type: String, optional: true, default_value: nil), FastlaneCore::ConfigItem.new(key: :related_work, description: "Array of related work items to add to the version (e.g. Confluence pages). " \ "Each entry is a hash with :url and :title keys. " \ "Items with a URL that already exists on the version are skipped", type: Array, optional: true, default_value: []) ] end |
.description ⇒ Object
41 42 43 |
# File 'lib/fastlane/plugin/apadmi_grout/actions/update_fix_version_action.rb', line 41 def self.description "Update the released status and/or description of a Jira version by name" end |
.is_supported?(_platform) ⇒ Boolean
75 76 77 |
# File 'lib/fastlane/plugin/apadmi_grout/actions/update_fix_version_action.rb', line 75 def self.is_supported?(_platform) true end |
.run(params) ⇒ Object
11 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 39 |
# File 'lib/fastlane/plugin/apadmi_grout/actions/update_fix_version_action.rb', line 11 def self.run(params) logger = FastLane::FastlaneLogger.new released = params[:released] description = params[:description] = params[:related_work] || [] UI.user_error!("Must provide at least one of: released, description, related_work") if released.nil? && description.nil? && .empty? build_tools = Apadmi::Grout::DIWrapper.di(params, logger) board_service = build_tools.board_service unless released.nil? && description.nil? kwargs = {} kwargs[:released] = released unless released.nil? kwargs[:description] = description unless description.nil? logger.("Updating version '#{params[:version_name]}'") board_service.update_version(params[:version_name], **kwargs) logger.success("Version '#{params[:version_name]}' updated") end .each do |link| UI.user_error!("Each related work entry must have a :url and :title") unless link[:url] && link[:title] logger.("Adding related work '#{link[:title]}' to version '#{params[:version_name]}'") board_service.(params[:version_name], link[:url], link[:title]) logger.success("Related work '#{link[:title]}' added to version '#{params[:version_name]}'") end end |