fastlane-plugin-apadmi_grout 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/lib/fastlane/plugin/apadmi_grout/actions/build_ipa_action.rb +98 -0
- data/lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb +24 -60
- data/lib/fastlane/plugin/apadmi_grout/actions/generate_release_notes_action.rb +18 -54
- data/lib/fastlane/plugin/apadmi_grout/actions/get_deployment_target_action.rb +69 -0
- data/lib/fastlane/plugin/apadmi_grout/actions/move_tickets_action.rb +64 -0
- data/lib/fastlane/plugin/apadmi_grout/utils/common_options.rb +70 -0
- data/lib/fastlane/plugin/apadmi_grout/utils/di_wrapper.rb +36 -0
- data/lib/fastlane/plugin/apadmi_grout/version.rb +1 -1
- metadata +8 -4
- data/lib/fastlane/plugin/apadmi_grout/actions/move_jira_tickets_action.rb +0 -112
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d02eac3252dcc39f75565411836b996092e96e83d7b6cc94fcfa7468205b2d40
|
4
|
+
data.tar.gz: 8631889511eaa1bcccf8fc43e3f678117bbb30667eab8e0c86a823f3b2850d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa0a969899d469ffbca92b37ba597509bf2a4d26d3c80cf5e5da3e72430d9cbe821b96a46caa3014c4246e8a47ca06bff7d7914c8f00af4ac3eab0e5ee1e9faf
|
7
|
+
data.tar.gz: 4b5809d27c8b2a35afa5d1f150efc00ae1c6fa1a3c499ba5b314eec54072b4d4010ced6d4fc4c863e85da99c90f554c1bd9c24a92d0f2143569be761797c03fe
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
# Fastlane Plugin Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [2.0.0] - 2022-05-25
|
4
|
+
* Implement ADO support for all relevant existing actions
|
4
5
|
|
5
|
-
## [1.
|
6
|
+
## [1.2.0] - 2022-05-17
|
7
|
+
* Automatically save generated release notes to a file on disk.
|
8
|
+
|
9
|
+
## [1.1.0] - 2022-05-12
|
10
|
+
* Support allowing tickets that aren't assigned to a sprint to be moved.
|
11
|
+
* Create action for obtaining iOS deployment target
|
6
12
|
|
13
|
+
## [1.0.0] - 2022-05-09 - Initial release
|
7
14
|
* Fastlane wrappers for new core functionality
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "fastlane/action"
|
4
|
+
require "apadmi_grout"
|
5
|
+
require "gym"
|
6
|
+
require_relative "../utils/fastlane_logger"
|
7
|
+
|
8
|
+
# WARNING: Since this is calling out to Gym, this isn't covered at all by tests
|
9
|
+
# Be very very careful before making any changes.
|
10
|
+
module Fastlane
|
11
|
+
module Actions
|
12
|
+
# Build an IPA binary
|
13
|
+
class BuildIpaAction < Action
|
14
|
+
def self.run(params)
|
15
|
+
logger = FastLane::FastlaneLogger.new
|
16
|
+
|
17
|
+
output_name = params[:output_name] || Apadmi::Grout::FilenameUtils.binary_output_filename(
|
18
|
+
client_name: params[:client_name],
|
19
|
+
product_name: params[:product_name],
|
20
|
+
platform: "iOS",
|
21
|
+
version: params[:version],
|
22
|
+
build_number: params[:build_number],
|
23
|
+
suffix: params[:suffix]
|
24
|
+
)
|
25
|
+
|
26
|
+
logger.message("Generating IPA: #{output_name}.ipa")
|
27
|
+
new_params = params
|
28
|
+
new_params[:output_name] = output_name
|
29
|
+
|
30
|
+
# Output dir being "." is the gym default, so overwrite this
|
31
|
+
if params[:output_directory].empty? || params[:output_directory] == "."
|
32
|
+
new_params[:output_directory] = ENV["BITRISE_DEPLOY_DIR"] || "#{Apadmi::Grout::GitUtils.git_root}/build"
|
33
|
+
end
|
34
|
+
|
35
|
+
result = Fastlane::Actions::GymAction.run(new_params)
|
36
|
+
|
37
|
+
logger.success("Generated #{output_name}.ipa in #{result}")
|
38
|
+
result
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.description
|
42
|
+
"Builds an IPA"
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.authors
|
46
|
+
["samdc@apadmi.com"]
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.available_options
|
50
|
+
[
|
51
|
+
FastlaneCore::ConfigItem.new(key: :client_name,
|
52
|
+
description: "The name of the ipa's client",
|
53
|
+
env_name: "CLIENT_NAME",
|
54
|
+
type: String,
|
55
|
+
verify_block: proc do |value|
|
56
|
+
UI.user_error!("Didn't pass a valid client name") unless value
|
57
|
+
end,
|
58
|
+
optional: false),
|
59
|
+
FastlaneCore::ConfigItem.new(key: :product_name,
|
60
|
+
description: "The name of the product",
|
61
|
+
env_name: "PRODUCT_NAME",
|
62
|
+
type: String,
|
63
|
+
verify_block: proc do |value|
|
64
|
+
UI.user_error!("Didn't pass a valid product name") unless value
|
65
|
+
end,
|
66
|
+
optional: false),
|
67
|
+
FastlaneCore::ConfigItem.new(key: :version,
|
68
|
+
description: "The app version e.g. 0.1.0",
|
69
|
+
type: String,
|
70
|
+
verify_block: proc do |value|
|
71
|
+
UI.user_error!("Didn't pass a valid version name") unless value
|
72
|
+
end,
|
73
|
+
optional: false),
|
74
|
+
FastlaneCore::ConfigItem.new(key: :build_number,
|
75
|
+
description: "The app build number e.g. 3948",
|
76
|
+
default_value: Apadmi::Grout::GitUtils.number_of_commits,
|
77
|
+
type: String,
|
78
|
+
verify_block: proc do |value|
|
79
|
+
UI.user_error!("Didn't pass a valid build number") unless value
|
80
|
+
end,
|
81
|
+
optional: false),
|
82
|
+
FastlaneCore::ConfigItem.new(key: :suffix,
|
83
|
+
description: "Suffix to identify what this output is (e.g. SOURCE, UAT, QA, DEV)",
|
84
|
+
type: String,
|
85
|
+
default_value: "",
|
86
|
+
verify_block: proc do |value|
|
87
|
+
UI.user_error!("Didn't pass a valid suffix") unless value
|
88
|
+
end,
|
89
|
+
optional: false)
|
90
|
+
] + Gym::Options.available_options
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.is_supported?(platform)
|
94
|
+
platform == :ios
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -12,19 +12,14 @@ module Fastlane
|
|
12
12
|
logger = FastLane::FastlaneLogger.new
|
13
13
|
logger.message("Finding tickets to move")
|
14
14
|
|
15
|
-
build_tools = Apadmi::Grout::
|
16
|
-
params[:jira_username],
|
17
|
-
params[:jira_api_token],
|
18
|
-
params[:jira_base_url],
|
19
|
-
params[:jira_context_path],
|
20
|
-
params[:jira_project_key],
|
21
|
-
logger
|
22
|
-
)
|
15
|
+
build_tools = Apadmi::Grout::DIWrapper.di(params, logger)
|
23
16
|
|
24
17
|
build_tools.find_tickets_to_move_action.run(
|
25
|
-
params[:
|
26
|
-
params[:
|
27
|
-
[]
|
18
|
+
params[:board_component_name],
|
19
|
+
params[:board_status_from],
|
20
|
+
[],
|
21
|
+
params[:custom_flag_messages],
|
22
|
+
params[:options]
|
28
23
|
)
|
29
24
|
end
|
30
25
|
|
@@ -37,64 +32,33 @@ module Fastlane
|
|
37
32
|
end
|
38
33
|
|
39
34
|
def self.available_options
|
40
|
-
[
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
env_name: "JIRA_USERNAME",
|
45
|
-
type: String,
|
46
|
-
verify_block: proc do |value|
|
47
|
-
UI.user_error!("Didn't pass a valid JIRA username") unless value
|
48
|
-
end,
|
49
|
-
optional: false),
|
50
|
-
FastlaneCore::ConfigItem.new(key: :jira_api_token,
|
51
|
-
description: "JIRA api token for authentication with JIRA",
|
52
|
-
env_name: "JIRA_API_TOKEN",
|
53
|
-
type: String,
|
54
|
-
verify_block: proc do |value|
|
55
|
-
UI.user_error!("Didn't pass a valid JIRA api token") unless value
|
56
|
-
end,
|
57
|
-
optional: false),
|
58
|
-
FastlaneCore::ConfigItem.new(key: :jira_project_key,
|
59
|
-
description: "JIRA project key",
|
60
|
-
env_name: "JIRA_PROJECT_KEY",
|
35
|
+
Apadmi::Grout::CommonOptions.board_options + [
|
36
|
+
FastlaneCore::ConfigItem.new(key: :board_component_name,
|
37
|
+
description: "The component by which to filter tickets",
|
38
|
+
env_name: "BOARD_COMPONENT_NAME",
|
61
39
|
type: String,
|
62
40
|
verify_block: proc do |value|
|
63
|
-
UI.user_error!("Didn't pass a valid
|
41
|
+
UI.user_error!("Didn't pass a valid component") unless value
|
64
42
|
end,
|
65
43
|
optional: false),
|
66
|
-
FastlaneCore::ConfigItem.new(key: :
|
67
|
-
description: "
|
68
|
-
env_name: "
|
44
|
+
FastlaneCore::ConfigItem.new(key: :board_status_from,
|
45
|
+
description: "The status to filter by to find tickets",
|
46
|
+
env_name: "BOARD_STATUS_FROM",
|
69
47
|
type: String,
|
70
48
|
verify_block: proc do |value|
|
71
|
-
UI.user_error!("Didn't pass a valid
|
49
|
+
UI.user_error!("Didn't pass a valid status") unless value
|
72
50
|
end,
|
73
51
|
optional: false),
|
74
|
-
FastlaneCore::ConfigItem.new(key: :
|
75
|
-
description: "
|
76
|
-
|
77
|
-
default_value:
|
78
|
-
type: String,
|
52
|
+
FastlaneCore::ConfigItem.new(key: :custom_flag_messages,
|
53
|
+
description: "Custom messages to use when flagging tickets",
|
54
|
+
type: Apadmi::Grout::FlagMessages,
|
55
|
+
default_value: nil,
|
79
56
|
optional: true),
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
type: String,
|
86
|
-
verify_block: proc do |value|
|
87
|
-
UI.user_error!("Didn't pass a valid JIRA component") unless value
|
88
|
-
end,
|
89
|
-
optional: false),
|
90
|
-
FastlaneCore::ConfigItem.new(key: :jira_status_from,
|
91
|
-
description: "The JIRA status to filter by to find tickets",
|
92
|
-
env_name: "JIRA_STATUS_FROM",
|
93
|
-
type: String,
|
94
|
-
verify_block: proc do |value|
|
95
|
-
UI.user_error!("Didn't pass a valid JIRA status") unless value
|
96
|
-
end,
|
97
|
-
optional: false)
|
57
|
+
FastlaneCore::ConfigItem.new(key: :options,
|
58
|
+
description: "Additional options to customize search",
|
59
|
+
type: Apadmi::Grout::FindTicketsOptions,
|
60
|
+
default_value: nil,
|
61
|
+
optional: true)
|
98
62
|
]
|
99
63
|
end
|
100
64
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "fastlane/action"
|
4
4
|
require "apadmi_grout"
|
5
5
|
require_relative "../utils/fastlane_logger"
|
6
|
+
require "fileutils"
|
6
7
|
|
7
8
|
module Fastlane
|
8
9
|
module Actions
|
@@ -12,14 +13,7 @@ module Fastlane
|
|
12
13
|
logger = FastLane::FastlaneLogger.new
|
13
14
|
logger.message("Generating Release Notes")
|
14
15
|
|
15
|
-
build_tools = Apadmi::Grout::
|
16
|
-
params[:jira_username],
|
17
|
-
params[:jira_api_token],
|
18
|
-
params[:jira_base_url],
|
19
|
-
params[:jira_context_path],
|
20
|
-
params[:jira_project_key],
|
21
|
-
logger
|
22
|
-
)
|
16
|
+
build_tools = Apadmi::Grout::DIWrapper.di(params, logger)
|
23
17
|
|
24
18
|
logger.message("Finding changelog between #{params[:oldest_ref]} and #{params[:latest_ref]}")
|
25
19
|
changelog = Fastlane::Actions::ChangelogFromGitCommitsAction.run(
|
@@ -43,7 +37,14 @@ module Fastlane
|
|
43
37
|
)
|
44
38
|
|
45
39
|
logger.message("Generating Release Notes")
|
46
|
-
build_tools.generate_release_notes_action.run(config)
|
40
|
+
release_notes = build_tools.generate_release_notes_action.run(config)
|
41
|
+
|
42
|
+
FileUtils.mkdir_p(params[:output_dir])
|
43
|
+
file_name = "#{params[:output_dir]}/#{params[:release_notes_title]}-#{params[:app_version]}.md"
|
44
|
+
|
45
|
+
File.write(file_name, release_notes)
|
46
|
+
logger.success("Saved Release Notes to #{file_name}")
|
47
|
+
[release_notes, file_name]
|
47
48
|
end
|
48
49
|
|
49
50
|
def self.description
|
@@ -55,54 +56,13 @@ module Fastlane
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def self.return_value
|
58
|
-
"
|
59
|
+
"Array of two items: [release_notes_as_string, path_to_file_on_disk]"
|
59
60
|
end
|
60
61
|
|
61
62
|
def self.available_options
|
62
|
-
[
|
63
|
-
########## JIRA Auth ##########
|
64
|
-
FastlaneCore::ConfigItem.new(key: :jira_username,
|
65
|
-
description: "JIRA username for authentication with JIRA",
|
66
|
-
env_name: "JIRA_USERNAME",
|
67
|
-
type: String,
|
68
|
-
verify_block: proc do |value|
|
69
|
-
UI.user_error!("Didn't pass a valid JIRA username") unless value
|
70
|
-
end,
|
71
|
-
optional: false),
|
72
|
-
FastlaneCore::ConfigItem.new(key: :jira_api_token,
|
73
|
-
description: "JIRA api token for authentication with JIRA",
|
74
|
-
env_name: "JIRA_API_TOKEN",
|
75
|
-
type: String,
|
76
|
-
verify_block: proc do |value|
|
77
|
-
UI.user_error!("Didn't pass a valid JIRA api token") unless value
|
78
|
-
end,
|
79
|
-
optional: false),
|
80
|
-
FastlaneCore::ConfigItem.new(key: :jira_project_key,
|
81
|
-
description: "JIRA project key",
|
82
|
-
env_name: "JIRA_PROJECT_KEY",
|
83
|
-
type: String,
|
84
|
-
verify_block: proc do |value|
|
85
|
-
UI.user_error!("Didn't pass a valid JIRA project key, e.g PPT") unless value
|
86
|
-
end,
|
87
|
-
optional: false),
|
88
|
-
FastlaneCore::ConfigItem.new(key: :jira_base_url,
|
89
|
-
description: "JIRA base url for the organisation",
|
90
|
-
env_name: "JIRA_BASE_URL",
|
91
|
-
type: String,
|
92
|
-
verify_block: proc do |value|
|
93
|
-
UI.user_error!("Didn't pass a valid JIRA base url") unless value
|
94
|
-
end,
|
95
|
-
optional: false),
|
96
|
-
FastlaneCore::ConfigItem.new(key: :jira_context_path,
|
97
|
-
description: "JIRA context path whatever that is ¯\\_(ツ)_/¯",
|
98
|
-
env_name: "JIRA_CONTEXT_PATH",
|
99
|
-
default_value: "",
|
100
|
-
type: String,
|
101
|
-
optional: true),
|
102
|
-
|
103
|
-
########## Action Specific ##########
|
63
|
+
Apadmi::Grout::CommonOptions.board_options + [
|
104
64
|
FastlaneCore::ConfigItem.new(key: :tickets_moved_by_build,
|
105
|
-
description: "Any
|
65
|
+
description: "Any tickets who's state was moved by this build",
|
106
66
|
default_value: [],
|
107
67
|
type: Array,
|
108
68
|
optional: true),
|
@@ -163,7 +123,11 @@ module Fastlane
|
|
163
123
|
FastlaneCore::ConfigItem.new(key: :templates,
|
164
124
|
description: "Release notes templates",
|
165
125
|
default_value: Apadmi::Grout::Templates.default,
|
166
|
-
type: Apadmi::Grout::Templates)
|
126
|
+
type: Apadmi::Grout::Templates),
|
127
|
+
FastlaneCore::ConfigItem.new(key: :output_dir,
|
128
|
+
description: "Directory in which to save the release notes file",
|
129
|
+
default_value: ENV["BITRISE_DEPLOY_DIR"] || "#{Apadmi::Grout::GitUtils.git_root}/build",
|
130
|
+
type: String)
|
167
131
|
]
|
168
132
|
end
|
169
133
|
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "fastlane/action"
|
4
|
+
require "apadmi_grout"
|
5
|
+
require_relative "../utils/fastlane_logger"
|
6
|
+
|
7
|
+
# WARNING: Since this is calling out to Gym, this isn't covered at all by tests
|
8
|
+
# Be very very careful before making any changes.
|
9
|
+
module Fastlane
|
10
|
+
module Actions
|
11
|
+
# Build an IPA binary
|
12
|
+
class GetDeploymentTargetAction < Action
|
13
|
+
def self.run(params)
|
14
|
+
logger = FastLane::FastlaneLogger.new
|
15
|
+
|
16
|
+
configuration = params[:configuration]
|
17
|
+
project = Fastlane::Actions::GetVersionNumberAction.get_project!(
|
18
|
+
params[:xcodeproj_path_or_dir]
|
19
|
+
)
|
20
|
+
|
21
|
+
logger.message("Searching for target #{params[:target]} in #{params[:xcodeproj_path_or_dir]}")
|
22
|
+
target = Fastlane::Actions::GetVersionNumberAction.get_target!(
|
23
|
+
project,
|
24
|
+
params[:target]
|
25
|
+
)
|
26
|
+
|
27
|
+
target.build_configurations.each do |config|
|
28
|
+
next unless configuration.nil? || config.name == configuration
|
29
|
+
|
30
|
+
value = config.resolve_build_setting("IPHONEOS_DEPLOYMENT_TARGET")
|
31
|
+
return value unless value.blank?
|
32
|
+
end
|
33
|
+
|
34
|
+
raise "Could not find deployment target for #{params[:xcodeproj_path_or_dir]} and #{params[:target]}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.description
|
38
|
+
"Pulls the deployment target from the XCode project"
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.authors
|
42
|
+
["samdc@apadmi.com"]
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.available_options
|
46
|
+
[
|
47
|
+
FastlaneCore::ConfigItem.new(key: :xcodeproj_path_or_dir,
|
48
|
+
description: "Path to, or directory of xcode project file",
|
49
|
+
type: String,
|
50
|
+
default_value: ".",
|
51
|
+
optional: false),
|
52
|
+
FastlaneCore::ConfigItem.new(key: :target,
|
53
|
+
description: "The target who's deployment target you want",
|
54
|
+
type: String,
|
55
|
+
default_value: "app",
|
56
|
+
optional: false),
|
57
|
+
FastlaneCore::ConfigItem.new(key: :configuration,
|
58
|
+
description: "The configuration who's target you want",
|
59
|
+
type: String,
|
60
|
+
optional: true)
|
61
|
+
]
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.is_supported?(platform)
|
65
|
+
platform == :ios
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "fastlane/action"
|
4
|
+
require "apadmi_grout"
|
5
|
+
require_relative "../utils/fastlane_logger"
|
6
|
+
|
7
|
+
module Fastlane
|
8
|
+
module Actions
|
9
|
+
# Move JIRA tickets and generate release notes
|
10
|
+
class MoveTicketsAction < Action
|
11
|
+
def self.run(params)
|
12
|
+
logger = FastLane::FastlaneLogger.new
|
13
|
+
logger.message("Moving #{params[:board_provider]} tickets")
|
14
|
+
|
15
|
+
build_tools = Apadmi::Grout::DIWrapper.di(params, logger)
|
16
|
+
|
17
|
+
build_tools.move_tickets_action.run(
|
18
|
+
params[:versions],
|
19
|
+
params[:issues],
|
20
|
+
params[:board_status_to]
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.description
|
25
|
+
"Convenience lane that moves all supplied jira tickets to new status and assigns versions."
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.authors
|
29
|
+
["samdc@apadmi.com"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.available_options
|
33
|
+
Apadmi::Grout::CommonOptions.board_options + [
|
34
|
+
FastlaneCore::ConfigItem.new(key: :board_status_to,
|
35
|
+
description: "The JIRA status to move the tickets to",
|
36
|
+
env_name: "BOARD_STATUS_TO",
|
37
|
+
type: String,
|
38
|
+
verify_block: proc do |value|
|
39
|
+
UI.user_error!("Didn't pass a valid JIRA status") unless value
|
40
|
+
end,
|
41
|
+
optional: false),
|
42
|
+
FastlaneCore::ConfigItem.new(key: :versions,
|
43
|
+
description: "The versions to add to the jira ticket",
|
44
|
+
type: Array,
|
45
|
+
verify_block: proc do |value|
|
46
|
+
UI.user_error!("Didn't pass a valid array of versions") unless value || value.empty
|
47
|
+
end,
|
48
|
+
optional: false),
|
49
|
+
FastlaneCore::ConfigItem.new(key: :issues,
|
50
|
+
description: "The issues to be moved",
|
51
|
+
type: Array,
|
52
|
+
verify_block: proc do |value|
|
53
|
+
UI.user_error!("Didn't pass a valid array of issues") unless value
|
54
|
+
end,
|
55
|
+
optional: false)
|
56
|
+
]
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.is_supported?(_platform)
|
60
|
+
true
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Apadmi
|
4
|
+
module Grout
|
5
|
+
# Common options used to setup ADO and JIRA integration
|
6
|
+
class CommonOptions
|
7
|
+
def self.board_options
|
8
|
+
[
|
9
|
+
FastlaneCore::ConfigItem.new(key: :board_base_url,
|
10
|
+
description: "Base url for the organisation",
|
11
|
+
env_name: "BOARD_BASE_URL",
|
12
|
+
type: String,
|
13
|
+
verify_block: proc do |value|
|
14
|
+
UI.user_error!("Didn't pass a valid base url") unless value
|
15
|
+
end,
|
16
|
+
optional: false),
|
17
|
+
FastlaneCore::ConfigItem.new(key: :board_provider,
|
18
|
+
description: "The board provider, valid values: ADO|JIRA",
|
19
|
+
env_name: "BOARD_PROVIDER",
|
20
|
+
type: String,
|
21
|
+
default_value: "JIRA",
|
22
|
+
verify_block: proc do |value|
|
23
|
+
UI.user_error!("Didn't pass a valid board provider") unless value
|
24
|
+
end,
|
25
|
+
optional: false)
|
26
|
+
] + ado_options + jira_options
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.ado_options
|
30
|
+
[
|
31
|
+
FastlaneCore::ConfigItem.new(key: :ado_pat,
|
32
|
+
description: "ADO personal access token for authentication",
|
33
|
+
env_name: "ADO_PAT",
|
34
|
+
type: String,
|
35
|
+
verify_block: proc do |value|
|
36
|
+
UI.user_error!("Didn't pass a valid personal access token") unless value
|
37
|
+
end,
|
38
|
+
optional: true)
|
39
|
+
]
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.jira_options
|
43
|
+
[
|
44
|
+
FastlaneCore::ConfigItem.new(key: :jira_username,
|
45
|
+
description: "JIRA username for authentication with JIRA",
|
46
|
+
env_name: "JIRA_USERNAME",
|
47
|
+
type: String,
|
48
|
+
optional: true),
|
49
|
+
FastlaneCore::ConfigItem.new(key: :jira_api_token,
|
50
|
+
description: "JIRA api token for authentication with JIRA",
|
51
|
+
env_name: "JIRA_API_TOKEN",
|
52
|
+
type: String,
|
53
|
+
optional: true),
|
54
|
+
FastlaneCore::ConfigItem.new(key: :jira_project_key,
|
55
|
+
description: "JIRA project key",
|
56
|
+
env_name: "JIRA_PROJECT_KEY",
|
57
|
+
type: String,
|
58
|
+
optional: true),
|
59
|
+
|
60
|
+
FastlaneCore::ConfigItem.new(key: :jira_context_path,
|
61
|
+
description: "JIRA context path whatever that is ¯\\_(ツ)_/¯",
|
62
|
+
env_name: "JIRA_CONTEXT_PATH",
|
63
|
+
default_value: "",
|
64
|
+
type: String,
|
65
|
+
optional: true)
|
66
|
+
]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Apadmi
|
4
|
+
module Grout
|
5
|
+
# Helper function for constructing the DI from params
|
6
|
+
class DIWrapper
|
7
|
+
def self.di(params, logger)
|
8
|
+
case params[:board_provider]
|
9
|
+
when "ADO"
|
10
|
+
raise "Invalid ADO personal access token" if params[:ado_pat].blank?
|
11
|
+
|
12
|
+
Apadmi::Grout::DependencyInjector.init_for_ado(
|
13
|
+
params[:ado_pat],
|
14
|
+
params[:board_base_url],
|
15
|
+
logger
|
16
|
+
)
|
17
|
+
when "JIRA"
|
18
|
+
raise "Invalid jira username" if params[:jira_username].blank?
|
19
|
+
raise "Invalid jira_api_token" if params[:jira_api_token].blank?
|
20
|
+
raise "Invalid jira_project_key" if params[:jira_project_key].blank?
|
21
|
+
|
22
|
+
Apadmi::Grout::DependencyInjector.init_for_jira(
|
23
|
+
params[:jira_username],
|
24
|
+
params[:jira_api_token],
|
25
|
+
params[:board_base_url],
|
26
|
+
params[:jira_context_path],
|
27
|
+
params[:jira_project_key],
|
28
|
+
logger
|
29
|
+
)
|
30
|
+
else
|
31
|
+
raise "Unsupported board provider: #{params[:board_provider]}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-apadmi_grout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Apadmi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apadmi_grout
|
@@ -160,9 +160,13 @@ files:
|
|
160
160
|
- CHANGELOG.md
|
161
161
|
- LICENSE
|
162
162
|
- lib/fastlane/plugin/apadmi_grout.rb
|
163
|
+
- lib/fastlane/plugin/apadmi_grout/actions/build_ipa_action.rb
|
163
164
|
- lib/fastlane/plugin/apadmi_grout/actions/find_tickets_to_move_action.rb
|
164
165
|
- lib/fastlane/plugin/apadmi_grout/actions/generate_release_notes_action.rb
|
165
|
-
- lib/fastlane/plugin/apadmi_grout/actions/
|
166
|
+
- lib/fastlane/plugin/apadmi_grout/actions/get_deployment_target_action.rb
|
167
|
+
- lib/fastlane/plugin/apadmi_grout/actions/move_tickets_action.rb
|
168
|
+
- lib/fastlane/plugin/apadmi_grout/utils/common_options.rb
|
169
|
+
- lib/fastlane/plugin/apadmi_grout/utils/di_wrapper.rb
|
166
170
|
- lib/fastlane/plugin/apadmi_grout/utils/fastlane_logger.rb
|
167
171
|
- lib/fastlane/plugin/apadmi_grout/version.rb
|
168
172
|
homepage: https://bitbucket.org/apadmi/apadmi-grout-ruby/
|
@@ -1,112 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "fastlane/action"
|
4
|
-
require "apadmi_grout"
|
5
|
-
require_relative "../utils/fastlane_logger"
|
6
|
-
|
7
|
-
module Fastlane
|
8
|
-
module Actions
|
9
|
-
# Move JIRA tickets and generate release notes
|
10
|
-
class MoveJiraTicketsAction < Action
|
11
|
-
def self.run(params)
|
12
|
-
logger = FastLane::FastlaneLogger.new
|
13
|
-
logger.message("Moving Jira tickets")
|
14
|
-
|
15
|
-
build_tools = Apadmi::Grout::DependencyInjector.new(
|
16
|
-
params[:jira_username],
|
17
|
-
params[:jira_api_token],
|
18
|
-
params[:jira_base_url],
|
19
|
-
params[:jira_context_path],
|
20
|
-
params[:jira_project_key],
|
21
|
-
logger
|
22
|
-
)
|
23
|
-
|
24
|
-
build_tools.move_jira_tickets_action.run(
|
25
|
-
params[:versions],
|
26
|
-
params[:issues],
|
27
|
-
params[:jira_status_to]
|
28
|
-
)
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.description
|
32
|
-
"Convenience lane that moves all supplied jira tickets to new status and assigns versions."
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.authors
|
36
|
-
["samdc@apadmi.com"]
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.available_options
|
40
|
-
[
|
41
|
-
########## JIRA Auth ##########
|
42
|
-
FastlaneCore::ConfigItem.new(key: :jira_username,
|
43
|
-
description: "JIRA username for authentication with JIRA",
|
44
|
-
env_name: "JIRA_USERNAME",
|
45
|
-
type: String,
|
46
|
-
verify_block: proc do |value|
|
47
|
-
UI.user_error!("Didn't pass a valid JIRA username") unless value
|
48
|
-
end,
|
49
|
-
optional: false),
|
50
|
-
FastlaneCore::ConfigItem.new(key: :jira_api_token,
|
51
|
-
description: "JIRA api token for authentication with JIRA",
|
52
|
-
env_name: "JIRA_API_TOKEN",
|
53
|
-
type: String,
|
54
|
-
verify_block: proc do |value|
|
55
|
-
UI.user_error!("Didn't pass a valid JIRA api token") unless value
|
56
|
-
end,
|
57
|
-
optional: false),
|
58
|
-
FastlaneCore::ConfigItem.new(key: :jira_project_key,
|
59
|
-
description: "JIRA project key",
|
60
|
-
env_name: "JIRA_PROJECT_KEY",
|
61
|
-
type: String,
|
62
|
-
verify_block: proc do |value|
|
63
|
-
UI.user_error!("Didn't pass a valid JIRA project key, e.g PPT") unless value
|
64
|
-
end,
|
65
|
-
optional: false),
|
66
|
-
FastlaneCore::ConfigItem.new(key: :jira_base_url,
|
67
|
-
description: "JIRA base url for the organisation",
|
68
|
-
env_name: "JIRA_BASE_URL",
|
69
|
-
type: String,
|
70
|
-
verify_block: proc do |value|
|
71
|
-
UI.user_error!("Didn't pass a valid JIRA base url") unless value
|
72
|
-
end,
|
73
|
-
optional: false),
|
74
|
-
FastlaneCore::ConfigItem.new(key: :jira_context_path,
|
75
|
-
description: "JIRA context path whatever that is ¯\\_(ツ)_/¯",
|
76
|
-
env_name: "JIRA_CONTEXT_PATH",
|
77
|
-
default_value: "",
|
78
|
-
type: String,
|
79
|
-
optional: true),
|
80
|
-
|
81
|
-
########## Action Specific ##########
|
82
|
-
FastlaneCore::ConfigItem.new(key: :jira_status_to,
|
83
|
-
description: "The JIRA status to move the tickets to",
|
84
|
-
env_name: "JIRA_STATUS_TO",
|
85
|
-
type: String,
|
86
|
-
verify_block: proc do |value|
|
87
|
-
UI.user_error!("Didn't pass a valid JIRA status") unless value
|
88
|
-
end,
|
89
|
-
optional: false),
|
90
|
-
FastlaneCore::ConfigItem.new(key: :versions,
|
91
|
-
description: "The versions to add to the jira ticket",
|
92
|
-
type: Array,
|
93
|
-
verify_block: proc do |value|
|
94
|
-
UI.user_error!("Didn't pass a valid array of versions") unless value || value.empty
|
95
|
-
end,
|
96
|
-
optional: false),
|
97
|
-
FastlaneCore::ConfigItem.new(key: :issues,
|
98
|
-
description: "The issues to be moved",
|
99
|
-
type: Array,
|
100
|
-
verify_block: proc do |value|
|
101
|
-
UI.user_error!("Didn't pass a valid array of issues") unless value
|
102
|
-
end,
|
103
|
-
optional: false)
|
104
|
-
]
|
105
|
-
end
|
106
|
-
|
107
|
-
def self.is_supported?(_platform)
|
108
|
-
true
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|