Last active
September 23, 2020 19:21
-
-
Save mariia-cherniuk/273d93de9bfa5decdc87b0a56387a32f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Publish jira release" | |
lane :publish_jira_release do | |
Actions.sh("git remote set-url origin [email protected]:your_app_git_url") | |
git_checkout(remote_branch: ENV['MASTER_BRANCH']) | |
git_pull | |
version_number = ENV['MPG_VERSION_NUMBER'].to_s.empty? ? get_version_number : ENV['MPG_VERSION_NUMBER'] | |
publish_jira_version_release(version: version_number) | |
end | |
desc "Closes tickets and publish a \"Jira\" release" | |
lane :publish_jira_version_release do |options| | |
version = options[:version] | |
if !version | |
UI.abort_with_message!("Specify version!") | |
end | |
tickets = tickets_in_the_last_release() | |
next if tickets.empty? | |
set_jira_fix_version_to_tickets(version: version, tickets: tickets) | |
transition_jira_tickets_to_closed(tickets: tickets) | |
release_jira_fix_version(version: version) | |
end | |
private_lane :set_jira_fix_version_to_tickets do |options| | |
set_jira_fix_version_fork( | |
version_name: options[:version], | |
issue_ids: options[:tickets], | |
project_key: ENV['JIRA_PROJECT'], | |
url: ENV['JIRA_URL'], | |
username: ENV['JIRA_USER'], | |
password: ENV['JIRA_PASSWORD'] | |
) | |
end | |
private_lane :transition_jira_tickets_to_closed do |options| | |
jira_transition_tickets( | |
issue_ids: options[:tickets], | |
project_key: ENV['JIRA_PROJECT'], | |
url: ENV['JIRA_URL'], | |
username: ENV['JIRA_USER'], | |
password: ENV['JIRA_PASSWORD'], | |
transition: ENV['JIRA_SUBMITTED_TRANSITION'] | |
) | |
end | |
private_lane :release_jira_fix_version do |options| | |
release_jira_version( | |
url: ENV['JIRA_URL'], | |
username: ENV['JIRA_USER'], | |
password: ENV['JIRA_PASSWORD'], | |
project_name: ENV['JIRA_PROJECT'], | |
name: options[:version] | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment