fastlane-plugin-jira_set_feature_build 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 91ef85f04ec456a0f2304a151bf013145aa5565533465d5f76d7c29feee0defd
4
+ data.tar.gz: fa9ce3ffd438dc33969bdb2d267db0de04c27157e221954779820fb177e2722d
5
+ SHA512:
6
+ metadata.gz: 407f76d0ad70ba942bfc2d1ac690cb8abebef065eee5a409d0532d2f610ef2889240916d8023bc63546b85888b97e8ba7bfec89bb099672c0c221a938e9949be
7
+ data.tar.gz: 7a260bdf9ed6c6c309a212c7d874cb4b5818e958ca6708accb1c88d43fa03ee09cacf0d33d4d398b29fce16d26512ca9eb6b376272dc8f5fe0d4d184b02c5ee9
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Tommy Sadiq Hinrichsen <tommy.lynge@gmail.com>
4
+ Copyright (c) 2020 Brandon McAnsh <brandon.mcansh@gmail.com>
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,63 @@
1
+ # jira_set_fix_version plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-jira_set_fix_version)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-jira_set_fix_version`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin jira_set_fix_version
11
+ ```
12
+
13
+ ## About jira_set_fix_version
14
+
15
+ Tags all Jira issues mentioned in git changelog with with a fix version from parameter :name
16
+
17
+ Usage:
18
+
19
+ ```ruby
20
+ lane :update_jira do
21
+ version_number = get_version_number
22
+ build_number = get_build_number
23
+ lane = lane_context[SharedValues::LANE_NAME].split[-1]
24
+ jira_set_fix_version(
25
+ name: "#{lane} #{version_number} (#{build_number})"
26
+ )
27
+ end
28
+ ```
29
+
30
+ Thank you to https://github.com/valeriomazzeo/fastlane-plugin-jira_transition and https://github.com/valeriomazzeo/fastlane-plugin-jira_transition for inspiration.
31
+
32
+ ## Example
33
+
34
+ Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane update_jira`.
35
+
36
+ ## Run tests for this plugin
37
+
38
+ To run both the tests, and code style validation, run
39
+
40
+ ```
41
+ rake
42
+ ```
43
+
44
+ To automatically fix many of the styling issues, use
45
+ ```
46
+ rubocop -a
47
+ ```
48
+
49
+ ## Issues and Feedback
50
+
51
+ For any other issues and feedback about this plugin, please submit it to this repository.
52
+
53
+ ## Troubleshooting
54
+
55
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
56
+
57
+ ## Using _fastlane_ Plugins
58
+
59
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
60
+
61
+ ## About _fastlane_
62
+
63
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/jira_set_feature_build/version'
2
+
3
+ module Fastlane
4
+ module JiraSetFeatureBuild
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
+ end
9
+ end
10
+ end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::JiraSetFeatureBuild.all_classes.each do |current|
15
+ require current
16
+ end
@@ -0,0 +1,156 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/jira_set_feature_build_helper'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ module SharedValues
7
+ CREATE_JIRA_FEATURE_BUILD_URL = :CREATE_JIRA_FEATURE_BUILD_URL
8
+ end
9
+
10
+ class JiraSetFeatureBuildAction < Action
11
+
12
+ def self.run(params)
13
+ puts "Running jira_set_feature_build Plugin"
14
+ Actions.verify_gem!('jira-ruby')
15
+ require "jira-ruby"
16
+
17
+ site = params[:url]
18
+ context_path = ''
19
+ auth_type = :basic
20
+ username = params[:username]
21
+ password = params[:password]
22
+ project_name = params[:project_name]
23
+ name = params[:name]
24
+ description = params[:description]
25
+ archived = params[:archived]
26
+ released = params[:released]
27
+ start_date = params[:start_date]
28
+
29
+ options = {
30
+ username: username,
31
+ password: password,
32
+ site: site,
33
+ context_path: context_path,
34
+ auth_type: auth_type,
35
+ read_timeout: 120
36
+ }
37
+
38
+ client = JIRA::Client.new(options)
39
+ puts "Client created: "
40
+ puts client
41
+
42
+
43
+ unless project_name.nil?
44
+
45
+
46
+ puts "Looking for a Project cookie " + project_name
47
+ begin
48
+ project = client.Project.find(project_name)
49
+ rescue JIRA::HTTPError => e
50
+ puts "Error during accesing to Project"
51
+ puts e.response.code
52
+ puts e.response.message
53
+ end
54
+
55
+ puts "Project found!"
56
+ project_id = project.id
57
+ puts "Project ID found: " + project_id
58
+
59
+ puts feature_build_url
60
+ end
61
+
62
+ if start_date.nil?
63
+ start_date = Date.today.to_s
64
+ end
65
+
66
+ ticket_number = Actions.lane_context[SharedValues::FL_CREATE_JIRA_TICKET_REFERENCE]
67
+ puts "Received ticket numbers: "
68
+ puts ticket_numbers
69
+
70
+ ticket_numbers.each do |issue_id|
71
+ begin
72
+ issue = client.Issue.find(issue_id)
73
+ issue.save({"fields"=>{ "Feature Build URL" => feature_build_url }})
74
+ rescue JIRA::HTTPError
75
+ "Skipping issue #{issue_id}"
76
+ end
77
+ end
78
+
79
+ Actions.lane_context[SharedValues::CREATE_JIRA_FEATURE_BUILD_URL] = feature_build_url
80
+
81
+ def self.description
82
+ "Tags the provided JIRA issue with a feature build URL from parameter :url"
83
+ end
84
+
85
+ def self.authors
86
+ ["Tommy Sadiq Hinrichsen", "Brandon McAnsh"]
87
+ end
88
+
89
+ def self.return_value
90
+ "Return the URL of the feature build"
91
+ end
92
+
93
+ def self.details
94
+ "This action requires jira-ruby gem"
95
+
96
+ end
97
+
98
+ def self.available_options
99
+ [
100
+ FastlaneCore::ConfigItem.new(key: :url,
101
+ env_name: "FL_CREATE_JIRA_VERSION_SITE",
102
+ description: "URL for Jira instance",
103
+ type: String,
104
+ verify_block: proc do |value|
105
+ UI.user_error!("No url for Jira given, pass using `url: 'url'`") unless value and !value.empty?
106
+ end),
107
+ FastlaneCore::ConfigItem.new(key: :username,
108
+ env_name: "FL_CREATE_JIRA_VERSION_USERNAME",
109
+ description: "Username for JIRA instance",
110
+ type: String,
111
+ verify_block: proc do |value|
112
+ UI.user_error!("No username given, pass using `username: 'jira_user'`") unless value and !value.empty?
113
+ end),
114
+ FastlaneCore::ConfigItem.new(key: :password,
115
+ env_name: "FL_CREATE_JIRA_VERSION_PASSWORD",
116
+ description: "Password for Jira",
117
+ type: String,
118
+ verify_block: proc do |value|
119
+ UI.user_error!("No password given, pass using `password: 'T0PS3CR3T'`") unless value and !value.empty?
120
+ end),
121
+ FastlaneCore::ConfigItem.new(key: :project_name,
122
+ env_name: "FL_CREATE_JIRA_VERSION_PROJECT_NAME",
123
+ description: "Project ID for the JIRA project. E.g. the short abbreviation in the JIRA ticket tags",
124
+ type: String,
125
+ optional: true,
126
+ conflicting_options: [:project_id],
127
+ conflict_block: proc do |value|
128
+ UI.user_error!("You can't use 'project_name' and '#{project_id}' options in one run")
129
+ end,
130
+ verify_block: proc do |value|
131
+ UI.user_error!("No Project ID given, pass using `project_id: 'PROJID'`") unless value and !value.empty?
132
+ end),
133
+ FastlaneCore::ConfigItem.new(key: :feature_build_url,
134
+ env_name: "FL_CREATE_JIRA_FEATURE_BUILD_URL",
135
+ description: "The url of the feature build from the CI job",
136
+ type: String,
137
+ verify_block: proc do |value|
138
+ UI.user_error!("No version name given, pass using `url: 'http://someurl'`") unless value and !value.empty?
139
+ end),
140
+ FastlaneCore::ConfigItem.new(key: :ticket_reference,
141
+ env_name: "FL_CREATE_JIRA_TICKET_REFERENCE",
142
+ description: "The ticket reference on JIRA",
143
+ type: String,
144
+ verify_block: proc do |value|
145
+ UI.user_error!("No version name given, pass using `url: 'http://someurl'`") unless value and !value.empty?
146
+ end),
147
+ ]
148
+ end
149
+
150
+ def self.is_supported?(platform)
151
+ true
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
5
+
6
+ module Helper
7
+ class JiraSetFeatureBuildHelper
8
+ # class methods that you define here become available in your action
9
+ # as `Helper::JiraSetFeatureBuildHelper.your_method`
10
+ #
11
+ def self.show_message
12
+ UI.message("Hello from the jira_set_fix_version plugin helper!")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module JiraSetFeatureBuild
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,188 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-jira_set_feature_build
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Tommy Sadiq Hinrichsen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jira-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec_junit_formatter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.49.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.49.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-require_tools
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: fastlane
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: 2.77.1
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 2.77.1
153
+ description:
154
+ email: tommy.lynge@gmail.com
155
+ executables: []
156
+ extensions: []
157
+ extra_rdoc_files: []
158
+ files:
159
+ - LICENSE
160
+ - README.md
161
+ - lib/fastlane/plugin/jira_set_feature_build.rb
162
+ - lib/fastlane/plugin/jira_set_feature_build/actions/jira_set_feature_build_action.rb
163
+ - lib/fastlane/plugin/jira_set_feature_build/helper/jira_set_feature_build_helper.rb
164
+ - lib/fastlane/plugin/jira_set_feature_build/version.rb
165
+ homepage: https://github.com/bmc08gt/fastlane-plugin-jira_feature_build
166
+ licenses:
167
+ - MIT
168
+ metadata: {}
169
+ post_install_message:
170
+ rdoc_options: []
171
+ require_paths:
172
+ - lib
173
+ required_ruby_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ required_rubygems_version: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ requirements: []
184
+ rubygems_version: 3.0.3
185
+ signing_key:
186
+ specification_version: 4
187
+ summary: Tags passed in Jira issue with a feature build url from parameter :url
188
+ test_files: []