{"id":370589,"date":"2024-05-21T04:28:48","date_gmt":"2024-05-21T04:28:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370589"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370589","title":{"rendered":"<span>Fastlane \u0434\u043b\u044f Android \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u043e\u0441\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0432\u043e\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0451\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438. \u041c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c bash-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0438\u043c\u0438 \u044d\u0442\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e? \u0422\u0443\u0442 \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u2014 Fastlane \u2014 \u0438 \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 Fastlane, \u0442\u0435\u043c, \u043a\u0442\u043e \u0438\u0449\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u0436\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 CI\/CD (Gitlab, Jenkins, Github Actions \u0438 \u0442\u043f).<\/p>\n<blockquote>\n<p>\u041d\u0435 \u0445\u043e\u0447\u0443 \u0447\u0438\u0442\u0430\u0442\u044c, \u0434\u0430\u0439 \u043c\u043d\u0435 \u043a\u043e\u0434:<a href=\"https:\/\/github.com\/maluginp\/fastlanetestproject\"> https:\/\/github.com\/maluginp\/fastlanetestproject<\/a><\/p>\n<\/blockquote>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u0434 Fastlane<\/h3>\n<p>\u0412\u0441\u0435\u0433\u0434\u0430 \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e Fastlane \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041e\u0445, \u043a\u0430\u043a \u0436\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u044f \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0430\u043b\u0441\u044f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u201c\u0445\u043e\u0442\u0435\u043b\u043e\u043a\u201d: \u043f\u0440\u043e\u0433\u043e\u043d unit-\u0442\u0435\u0441\u0442\u043e\u0432, \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u0442.\u043f. \u0423 Fastlane \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043d\u043e\u0441\u0438\u0442 \u043f\u0435\u0440\u043c\u0430\u043d\u0435\u043d\u0442\u043d\u044b\u0439 \u0432\u043a\u043b\u0430\u0434 \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u0421\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (action-\u043e\u0432) \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <a href=\"https:\/\/docs.fastlane.tools\/actions\/\">\u0442\u0443\u0442<\/a>. \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 iOS \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u0438 \u043a\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0448\u0430\u0440\u0438\u0442\u044c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043d\u0430\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f Fastlane. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 <a href=\"https:\/\/github.com\/maluginp\/fastlanetestproject\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Fastlane \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u043e <a href=\"https:\/\/docs.fastlane.tools\/getting-started\/android\/setup\/\">\u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e<\/a>.\u00a0<\/p>\n<p>Fastlane \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Fastlane \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b (lane-\u044b) \u043f\u043e\u0434 Android:<\/p>\n<pre><code class=\"ruby\">default_platform(:android)  platform :android do   desc \"Runs all the tests\"   lane :test do     gradle(task: \"test\")   end    desc \"Submit a new Beta Build to Crashlytics Beta\"   lane :beta do     gradle(task: \"clean assembleRelease\")     crashlytics        # sh \"your_script.sh\"     # You can also use other beta testing services here   end    desc \"Deploy a new version to the Google Play\"   lane :deploy do     gradle(task: \"clean assembleRelease\")     upload_to_play_store   end end<\/code><\/pre>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u043f\u0440\u043e\u0433\u043e\u043d \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u0442\u0440\u043f\u0430\u0432\u043a\u0430 \u0431\u0435\u0442\u044b \u0432 Crashlytics \u0438 Play store.<\/p>\n<h4>\u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u00a0<\/h4>\n<p>\u041f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0412\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0434\u0435\u043b\u0438\u043c \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044f Fastfile \u0432 \u0441\u0432\u0430\u043b\u043a\u0443. \u041c\u043d\u0435 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0432 \u0442\u043e\u043c \u0436\u0435 \u0441\u0442\u0438\u043b\u0435.<\/p>\n<blockquote>\n<p>\u041d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0441\u043f\u0435\u0446\u043e\u043c \u0432 Ruby, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0438\u0448\u0443, \u043a\u0430\u043a \u0443\u043c\u0435\u044e))<\/p>\n<\/blockquote>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u2014 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0444\u0438\u0442\u0447\u0430 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043a\u0440\u043e-\u0444\u0438\u0442\u0447 (\u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043b\u0438\u043d\u0442\u0435\u0440\u044b: <\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Linter methods module Linter    def self.detekt(throw_if_fails: true)     # .\/gradlew detekt   end    def self.lint(throw_if_fails: true)     # .\/gradlew lint   end end<\/code><\/pre>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u041a\u0435\u0439\u0441\u044b<\/h3>\n<h4>\u041f\u0440\u043e\u0433\u043e\u043d \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u043f\u0430\u043b\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430<\/h4>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0433\u043d\u0430\u0442\u044c detekt<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0433\u043d\u0430\u0442\u044c lint<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c detekt \u0438 lint \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <code>lane<\/code>.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 \u0434\u043b\u044f \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a gradle-\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0438 \u0434\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c: <\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Linter methods module Linter    def self.detekt(throw_if_fails: true)     Fastlane::Actions::GradleAction.run(       task: 'detekt',       project_dir: '..\/',       # \u0411\u0435\u0437 print_* \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442        # \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438       print_command: true,       print_command_output: true     )     true   # \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b Fastlane \u043a\u0438\u0434\u0430\u0435\u0442   # \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c   rescue FastlaneCore::Interface::FastlaneShellError     # \u041a\u0438\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0440\u0445 (\u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432)     # \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u044b\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443     raise if throw_if_fails      false   end    def self.lint(throw_if_fails: true)     Fastlane::Actions::GradleAction.run(       task: 'lint',       project_dir: '..\/',       print_command: true,       print_command_output: true     )     true   rescue FastlaneCore::Interface::FastlaneShellError     raise if throw_if_fails      false   end end<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 <code>lane<\/code> \u0432 Fastfile \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b: <\/p>\n<pre><code class=\"ruby\">desc 'Check linter rules' lane :lint do   lint_res = Linter.lint(throw_if_fails: false)   # \u041f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u043e\u0448\u0438\u0431\u043a\u0443   Fastlane::UI.error('Lint failed') unless lint_res    detekt_res = Linter.detekt(throw_if_fails: false) # \u041f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u043e\u0448\u0438\u0431\u043a\u0443   Fastlane::UI.error('Detekt failed') unless detekt_res    unless detekt_res &amp;&amp; lint_res     Fastlane::UI.user_error!(\"Lint failed. Result detekt = #{detekt_res}, lint = #{lint_res}\")   end end<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c <code>fastlane lint<\/code>, \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e, \u0447\u0442\u043e lane \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u043b\u043e\u0433\u0438: <\/p>\n<pre><code class=\"bash\">Lint failed. Result detekt = false, lint = true<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043a\u0435\u0439\u0441\u0443.<\/p>\n<h4>Safe-merge, \u043f\u0440\u043e\u0433\u043e\u043d unit-\u0442\u0435\u0441\u0442\u043e\u0432<\/h4>\n<p>\u0411\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0442\u043a\u0435 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442, \u043d\u043e \u043f\u0440\u0438 \u043c\u0435\u0440\u0436\u0435 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u043b\u0438\u043d\u0442\u0435\u0440 \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u043b\u043e\u043c\u0430\u044e\u0442\u0441\u044f (\u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 merge request-\u044b \u0438\u0434\u0443\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443). \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u0434\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0441\u0432\u0435\u0436\u0443\u044e \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443, \u043d\u043e \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043f\u0443\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c safe merge (\u0432 \u0432\u0435\u0442\u043a\u0443 \u0431\u0435\u0437 merge-\u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043f\u043e\u0434\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438), \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u044b \u0438 \u043b\u0438\u043d\u0442\u0435\u0440\u044b.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f safe-merge:<\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Safe merge for actual branch module SafeMerge    def self.main_branch? # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c \u0438\u0437 env-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432     ENV['MAIN_BRANCH'] == fetch_local_branch   end    def self.merge_main_no_commit     main_branch = ENV['MAIN_BRANCH']      local_git_branch = fetch_local_branch      command = [       'git',       'merge',       main_branch,       '--no-commit',       '--no-ff'     ]      Fastlane::Actions.sh(command.join(' '))     # \u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0440\u0436\u0430     Fastlane::UI.success(\"Successfully merged #{main_branch} (main branch) to #{local_git_branch}\")   end    def self.fetch_local_branch     local_git_branch = Fastlane::Actions.git_branch_name_using_HEAD     local_git_branch = Fastlane::Actions.git_branch unless local_git_branch &amp;&amp; local_git_branch != 'HEAD'     local_git_branch   end end<\/code><\/pre>\n<p>\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f unit-\u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 detekt \u0438 lint:<\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Unit test methods module UnitTests    def self.run(throw_if_fails: true)     Fastlane::Actions::GradleAction.run(       task: 'test',       project_dir: '..\/',       print_command: true,       print_command_output: true     )     true   rescue FastlaneCore::Interface::FastlaneShellError     raise if throw_if_fails      false   end end<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>lane<\/code> \u0434\u043b\u044f unit-\u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<pre><code class=\"ruby\">desc 'Run unit tests' lane :unitTest do # \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c safe-merge   # \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0442\u043a\u0430 \u0438 \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u0430\u044f   UI.message('Skip safe merge, the branch is main') if SafeMerge.main_branch?    SafeMerge.merge_main_no_commit unless SafeMerge.main_branch?    UnitTests.run end<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c <code>fastlane unitTest<\/code> , \u0435\u0441\u043b\u0438 unit-\u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0442\u043e <code>lane<\/code> \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0445\u043e\u043c.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043a\u0435\u0439\u0441\u0430\u043c.<\/p>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 Slack<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b QA \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0432\u0440\u0443\u0447\u043d\u0443\u044e (\u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443\u043c\u0435\u044e\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c) \u0438 \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0432 Slack.<\/p>\n<p>\u041d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a \u0434\u043b\u044f QA:<\/p>\n<pre><code class=\"ruby\">require 'fastlane'  require_relative 'building_slack'  # QA build methods module QABuild    def self.run(debug: false)     # \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0445\u0435\u043b\u043f\u0435\u0440 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 Slack-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439     thread = BuildingSlackThread.start( # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c \u0438\u0437 env-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432       ENV['SLACK_API_TOKEN'],       ENV['SLACK_QA_CHANNEL_BUILDS'],       'Building QA build...',       debug     )      begin       # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 APK-\u0444\u0430\u0439\u043b       Fastlane::Actions::GradleAction.run(           task: 'assemble',           flavor: '',           build_type: 'Release',           project_dir: \"..\/\",           print_command: true,           print_command_output: true       )  # \u0414\u043e\u0441\u0442\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 APK       completed_apk_path = Fastlane::Actions.lane_context[         Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH       ]  # \u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c APK-\u0444\u0430\u0439\u043b \u043a Slack-\u0442\u0440\u0435\u0434\u0443       thread.attach_file('APK file', completed_apk_path, 'app.apk')  # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 AAB-\u0444\u0430\u0439\u043b       Fastlane::Actions::GradleAction.run(           task: 'bundle',           flavor: '',           build_type: 'Release',           project_dir: \"..\/\",           print_command: true,           print_command_output: true       )  # \u0414\u043e\u0441\u0442\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 AAB       completed_aab_path = Fastlane::Actions.lane_context[         Fastlane::Actions::SharedValues::GRADLE_AAB_OUTPUT_PATH       ]        # \u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c AAB-\u0444\u0430\u0439\u043b \u043a Slack-\u0442\u0440\u0435\u0434\u0443       thread.attach_file('Bundle file', completed_aab_path, 'app.aab')        # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0440\u0435\u0434 - \u0441\u0431\u043e\u0440\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, # \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u0438\u0434\u0430\u0442\u044c \u0441\u043c\u0430\u0439\u043b\u043e\u0432       thread.success('Building QA build succeed')     rescue       # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0440\u0435\u0434 - \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u043b\u0430\u0441\u044c, # \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u0438\u0434\u0430\u0442\u044c \u0441\u043c\u0430\u0439\u043b\u043e\u0432 \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438       thread.failure('Building QA build failed')       raise # \u043a\u0438\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0440\u0445 \u043a \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443     end   end end<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0434\u0435\u0442, \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043d\u0430\u043c \u0443\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c CI \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e90\/66d\/f3c\/e9066df3ce4c31900cefdc7fe395be03.png\" alt=\"\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 Slack\" title=\"\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 Slack\" width=\"680\" height=\"668\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e90\/66d\/f3c\/e9066df3ce4c31900cefdc7fe395be03.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 Slack<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c lane \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0435\u0440\u0441\u0438\u0439 \u0434\u043b\u044f QA: <\/p>\n<pre><code class=\"ruby\">desc 'Submit release builds to QA via Slack' lane :qa do   QABuild.run(debug: true) end<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c <code>fastlane qa<\/code><\/p>\n<h4>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 Play Store \u0441 \u0440\u0430\u0441\u043a\u0430\u0442\u043a\u043e\u0439 10%<\/h4>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0434\u043b\u044f QA, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 action-\u0430 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 Play Store &#8212; <code>Fastlane::Actions::UploadToPlayStoreAction<\/code> <\/p>\n<pre><code class=\"ruby\">require 'fastlane'  module Deploy   def self.run(debug: false)     thread = BuildingSlackThread.start(       ENV['SLACK_API_TOKEN'],       ENV['SLACK_RELEASE_CHANNEL_BUILDS'],       'Releasing build...',       debug     )      begin       Fastlane::Actions::GradleAction.run(           task: 'assemble',           flavor: '',           build_type: 'Release',           project_dir: \"..\/\",           print_command: true,           print_command_output: true       )        completed_apk_path = Fastlane::Actions.lane_context[         Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH       ]        thread.attach_file('APK file', completed_apk_path, 'app.apk')        Fastlane::Actions::GradleAction.run(           task: 'bundle',           flavor: '',           build_type: 'Release',           project_dir: \"..\/\",           print_command: true,           print_command_output: true       )        completed_aab_path = Fastlane::Actions.lane_context[         Fastlane::Actions::SharedValues::GRADLE_AAB_OUTPUT_PATH       ]        thread.attach_file('Bundle file', completed_aab_path, 'app.aab')        unless debug         Fastlane::Actions::UploadToPlayStoreAction.run(           aab: completed_aab_path,           track: 'production',           rollout: 0.1 # 10%         )       end        thread.success('Releasing is completed and rollout on 10%')     rescue       thread.failure('Releasing is failed')       raise # re-raise     end   end end<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c lane \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f<\/p>\n<pre><code class=\"ruby\">desc 'Deploy a new version to the Google Play' lane :deploy do   Deploy.run(debug: true) end<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c <code>fastlane deploy<\/code><\/p>\n<h4>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 Slack<\/h4>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0440\u0435\u0434\u043e\u043c \u0432 Slack, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0442\u0440\u0435\u0434\u0430 \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0444\u0430\u0439\u043b\u044b. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b.<\/p>\n<p>\u041d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Slack, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440 \u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441-\u0445\u0435\u043b\u043f\u0435\u0440.<\/p>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Slack API \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u043f\u043b\u0430\u0433\u0438\u043d \u043a Fastlane: <code>fastlane-plugin-slack_bot<\/code><\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0432 Gemfile (\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430)<\/p>\n<pre><code class=\"ruby\">plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path)<\/code><\/pre>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 fastlane \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b Pluginfile \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c<\/p>\n<pre><code class=\"ruby\">gem 'fastlane-plugin-slack_bot'<\/code><\/pre>\n<p>\u0423 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430: <\/p>\n<pre><code class=\"ruby\">{root} |-- Gemfile |-- fastlane     |-- Pluginfile <\/code><\/pre>\n<p>\u0421\u0430\u043c \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<details class=\"spoiler\">\n<summary>BuildingSlackThread.rb<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"ruby\">require 'fastlane'  # Manage slack thread for building class BuildingSlackThread  # \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430   attr_accessor :api_token, :thread_ts, :thread_channel, :debug    def self.start(api_token, channel, message, debug = false)     Fastlane::UI.message(\"Sending start building message to Slack channel #{channel}\")  # \u041f\u0440\u0438 \u0434\u0435\u0431\u0430\u0433\u0435 \u043d\u0435 \u0448\u043b\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442     if debug       return BuildingSlackThread.new(api_token, channel, message, debug: debug)     end  # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0442\u0440\u0435\u0434 \u0432 \u043a\u0430\u043d\u0430\u043b\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438 \u0431\u0443\u0434\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c     thread_result = Fastlane::Actions::PostToSlackAction.run(       api_token: @api_token,       message: message,       success: true,       channel: @channel,       payload: [],       attachment_properties: {},       default_payloads: %i[lane git_branch git_author last_git_commit],     )      thread_ts = thread_result[:json][\"ts\"]     thread_channel = thread_result[:json][\"channel\"]      Fastlane::UI.error(\"Failed sending message to Slack to #{channel} channel\") unless thread_ts &amp;&amp; thread_channel      BuildingSlackThread(api_token, thread_ts, thread_channel, debug)   end    def initialize(api_token, thread_ts, thread_channel, debug: false)     @api_token = api_token     @thread_ts = thread_ts     @thread_channel = thread_channel     @debug = debug   end    def attach_file(message, file_path, file_name)     ext = file_name.split('.').last      Fastlane::UI.message(\"Attaching #{file_name} (ext = #{ext}) file is located in path #{file_path}\")      return if @debug      Fastlane::Actions::FileUploadToSlackAction.run(       api_token: @api_token,       initial_comment: message,       file_path: file_path,       file_name: file_name,       file_type: ext,       channels: @thread_channel,       thread_ts: @thread_ts     )   end    def success(message)     Fastlane::UI.message(\"Sending success building message\")      return if @debug      Fastlane::Actions::UpdateSlackMessageAction.run(       ts: @thread_ts,       api_token: @api_token,       message: message,       success: true,       channel: @thread_channel,       payload: [],       attachment_properties: {},       default_payloads: %i[lane git_branch git_author last_git_commit],     )   end    def failure(message)     Fastlane::UI.message(\"Sending failure building message\")      return if @debug      Fastlane::Actions::UpdateSlackMessageAction.run(       ts: @thread_ts,       api_token: @api_token,       message: message,       success: false,       channel: @thread_channel,       payload: [],       attachment_properties: {},       default_payloads: %i[lane git_branch git_author last_git_commit],     )   end end<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u041f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u043c<\/h3>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0441\u0430\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0431\u0435\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0441\u043e\u0431\u0440\u0430\u043d \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/maluginp\/fastlanetestproject\">\u0440\u0435\u043f\u0435<\/a>.<\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>Fastlane \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>Fastlane \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f Android \u0438 iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u0434\u043b\u044f iOS \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 CI\/CD<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043d\u044f\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u044b Ruby \u043c\u043e\u0436\u043d\u043e \u0437\u0430 \u0434\u0435\u043d\u044c, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0431\u044d\u043a\u0433\u0440\u0430\u0443\u043d\u0434 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u0421 \u043c\u043e\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043d\u0430 Ruby c Fastlane \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 Python.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/companies\/garage8\/articles\/799691\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0427\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 Android \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">28.57% <\/span><span class=\"tm-article-poll__answer-label\">Fastlane<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 28.57%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">42.86% <\/span><span class=\"tm-article-poll__answer-label\">Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 42.86%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">28.57% <\/span><span class=\"tm-article-poll__answer-label\">Kotlin Custom Scripts (kts)<\/span><span class=\"tm-article-poll__answer-votes\">2<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 28.57%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">57.14% <\/span><span class=\"tm-article-poll__answer-label\">Gradle-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/span><span class=\"tm-article-poll__answer-votes\">4<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 57.14%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">0% <\/span><span class=\"tm-article-poll__answer-label\">\u0414\u0440\u0443\u0433\u043e\u0435 (\u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445)<\/span><span class=\"tm-article-poll__answer-votes\">0<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 0%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 7 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 3 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/799691\/\"> https:\/\/habr.com\/ru\/articles\/799691\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u043e\u0441\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0432\u043e\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0451\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438. \u041c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c bash-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0438\u043c\u0438 \u044d\u0442\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e? \u0422\u0443\u0442 \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u2014 Fastlane \u2014 \u0438 \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0441 Fastlane, \u0442\u0435\u043c, \u043a\u0442\u043e \u0438\u0449\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0431\u043e\u0440\u043e\u043a \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u0436\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 CI\/CD (Gitlab, Jenkins, Github Actions \u0438 \u0442\u043f).<\/p>\n<blockquote>\n<p>\u041d\u0435 \u0445\u043e\u0447\u0443 \u0447\u0438\u0442\u0430\u0442\u044c, \u0434\u0430\u0439 \u043c\u043d\u0435 \u043a\u043e\u0434:<a href=\"https:\/\/github.com\/maluginp\/fastlanetestproject\"> https:\/\/github.com\/maluginp\/fastlanetestproject<\/a><\/p>\n<\/blockquote>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u0434 Fastlane<\/h3>\n<p>\u0412\u0441\u0435\u0433\u0434\u0430 \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e Fastlane \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u041e\u0445, \u043a\u0430\u043a \u0436\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u044f \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0430\u043b\u0441\u044f. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u201c\u0445\u043e\u0442\u0435\u043b\u043e\u043a\u201d: \u043f\u0440\u043e\u0433\u043e\u043d unit-\u0442\u0435\u0441\u0442\u043e\u0432, \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u0442.\u043f. \u0423 Fastlane \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043d\u043e\u0441\u0438\u0442 \u043f\u0435\u0440\u043c\u0430\u043d\u0435\u043d\u0442\u043d\u044b\u0439 \u0432\u043a\u043b\u0430\u0434 \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u0421\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (action-\u043e\u0432) \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <a href=\"https:\/\/docs.fastlane.tools\/actions\/\">\u0442\u0443\u0442<\/a>. \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 iOS \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u0438 \u043a\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0448\u0430\u0440\u0438\u0442\u044c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043d\u0430\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f Fastlane. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 <a href=\"https:\/\/github.com\/maluginp\/fastlanetestproject\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Fastlane \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u043e <a href=\"https:\/\/docs.fastlane.tools\/getting-started\/android\/setup\/\">\u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e<\/a>.\u00a0<\/p>\n<p>Fastlane \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Fastlane \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b (lane-\u044b) \u043f\u043e\u0434 Android:<\/p>\n<pre><code class=\"ruby\">default_platform(:android)  platform :android do   desc \"Runs all the tests\"   lane :test do     gradle(task: \"test\")   end    desc \"Submit a new Beta Build to Crashlytics Beta\"   lane :beta do     gradle(task: \"clean assembleRelease\")     crashlytics        # sh \"your_script.sh\"     # You can also use other beta testing services here   end    desc \"Deploy a new version to the Google Play\"   lane :deploy do     gradle(task: \"clean assembleRelease\")     upload_to_play_store   end end<\/code><\/pre>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u043f\u0440\u043e\u0433\u043e\u043d \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u0442\u0440\u043f\u0430\u0432\u043a\u0430 \u0431\u0435\u0442\u044b \u0432 Crashlytics \u0438 Play store.<\/p>\n<h4>\u041a\u0430\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u00a0<\/h4>\n<p>\u041f\u043e\u0434\u0435\u043b\u044e\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0412\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0434\u0435\u043b\u0438\u043c \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044f Fastfile \u0432 \u0441\u0432\u0430\u043b\u043a\u0443. \u041c\u043d\u0435 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0432 \u0442\u043e\u043c \u0436\u0435 \u0441\u0442\u0438\u043b\u0435.<\/p>\n<blockquote>\n<p>\u041d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u0441\u043f\u0435\u0446\u043e\u043c \u0432 Ruby, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0438\u0448\u0443, \u043a\u0430\u043a \u0443\u043c\u0435\u044e))<\/p>\n<\/blockquote>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u2014 \u044d\u0442\u043e \u043e\u0434\u043d\u0430 \u0444\u0438\u0442\u0447\u0430 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043a\u0440\u043e-\u0444\u0438\u0442\u0447 (\u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c), \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043b\u0438\u043d\u0442\u0435\u0440\u044b: <\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Linter methods module Linter    def self.detekt(throw_if_fails: true)     # .\/gradlew detekt   end    def self.lint(throw_if_fails: true)     # .\/gradlew lint   end end<\/code><\/pre>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u044b\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u041a\u0435\u0439\u0441\u044b<\/h3>\n<h4>\u041f\u0440\u043e\u0433\u043e\u043d \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u043f\u0430\u043b\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430<\/h4>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0433\u043d\u0430\u0442\u044c detekt<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0433\u043d\u0430\u0442\u044c lint<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c detekt \u0438 lint \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <code>lane<\/code>.<\/p>\n<p>\u0412 \u043c\u043e\u0434\u0443\u043b\u0435 \u0434\u043b\u044f \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a gradle-\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0438 \u0434\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c: <\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Linter methods module Linter    def self.detekt(throw_if_fails: true)     Fastlane::Actions::GradleAction.run(       task: 'detekt',       project_dir: '..\/',       # \u0411\u0435\u0437 print_* \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442        # \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438       print_command: true,       print_command_output: true     )     true   # \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b Fastlane \u043a\u0438\u0434\u0430\u0435\u0442   # \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c   rescue FastlaneCore::Interface::FastlaneShellError     # \u041a\u0438\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0440\u0445 (\u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432)     # \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u044b\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443     raise if throw_if_fails      false   end    def self.lint(throw_if_fails: true)     Fastlane::Actions::GradleAction.run(       task: 'lint',       project_dir: '..\/',       print_command: true,       print_command_output: true     )     true   rescue FastlaneCore::Interface::FastlaneShellError     raise if throw_if_fails      false   end end<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 <code>lane<\/code> \u0432 Fastfile \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b: <\/p>\n<pre><code class=\"ruby\">desc 'Check linter rules' lane :lint do   lint_res = Linter.lint(throw_if_fails: false)   # \u041f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u043e\u0448\u0438\u0431\u043a\u0443   Fastlane::UI.error('Lint failed') unless lint_res    detekt_res = Linter.detekt(throw_if_fails: false) # \u041f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u043e\u0448\u0438\u0431\u043a\u0443   Fastlane::UI.error('Detekt failed') unless detekt_res    unless detekt_res &amp;&amp; lint_res     Fastlane::UI.user_error!(\"Lint failed. Result detekt = #{detekt_res}, lint = #{lint_res}\")   end end<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c <code>fastlane lint<\/code>, \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e, \u0447\u0442\u043e lane \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u043b\u043e\u0433\u0438: <\/p>\n<pre><code class=\"bash\">Lint failed. Result detekt = false, lint = true<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043a\u0435\u0439\u0441\u0443.<\/p>\n<h4>Safe-merge, \u043f\u0440\u043e\u0433\u043e\u043d unit-\u0442\u0435\u0441\u0442\u043e\u0432<\/h4>\n<p>\u0411\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0442\u043a\u0435 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442, \u043d\u043e \u043f\u0440\u0438 \u043c\u0435\u0440\u0436\u0435 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u043b\u0438\u043d\u0442\u0435\u0440 \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u043b\u043e\u043c\u0430\u044e\u0442\u0441\u044f (\u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 merge request-\u044b \u0438\u0434\u0443\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443). \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u0434\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0441\u0432\u0435\u0436\u0443\u044e \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0432\u0435\u0442\u043a\u0443, \u043d\u043e \u043c\u044b \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043f\u0443\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c safe merge (\u0432 \u0432\u0435\u0442\u043a\u0443 \u0431\u0435\u0437 merge-\u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043f\u043e\u0434\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438), \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u044b \u0438 \u043b\u0438\u043d\u0442\u0435\u0440\u044b.<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f safe-merge:<\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Safe merge for actual branch module SafeMerge    def self.main_branch? # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c \u0438\u0437 env-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432     ENV['MAIN_BRANCH'] == fetch_local_branch   end    def self.merge_main_no_commit     main_branch = ENV['MAIN_BRANCH']      local_git_branch = fetch_local_branch      command = [       'git',       'merge',       main_branch,       '--no-commit',       '--no-ff'     ]      Fastlane::Actions.sh(command.join(' '))     # \u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433\u0430\u0445 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0440\u0436\u0430     Fastlane::UI.success(\"Successfully merged #{main_branch} (main branch) to #{local_git_branch}\")   end    def self.fetch_local_branch     local_git_branch = Fastlane::Actions.git_branch_name_using_HEAD     local_git_branch = Fastlane::Actions.git_branch unless local_git_branch &amp;&amp; local_git_branch != 'HEAD'     local_git_branch   end end<\/code><\/pre>\n<p>\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f unit-\u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 detekt \u0438 lint:<\/p>\n<pre><code class=\"ruby\">require 'fastlane'  # Unit test methods module UnitTests    def self.run(throw_if_fails: true)     Fastlane::Actions::GradleAction.run(       task: 'test',       project_dir: '..\/',       print_command: true,       print_command_output: true     )     true   rescue FastlaneCore::Interface::FastlaneShellError     raise if throw_if_fails      false   end end<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>lane<\/code> \u0434\u043b\u044f unit-\u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<pre><code class=\"ruby\">desc 'Run unit tests' lane :unitTest do # \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c safe-merge   # \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0442\u043a\u0430 \u0438 \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u043d\u0430\u044f   UI.message('Skip safe merge, the branch is main') if SafeMerge.main_branch?    SafeMerge.merge_main_no_commit unless SafeMerge.main_branch?    UnitTests.run end<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c <code>fastlane unitTest<\/code> , \u0435\u0441\u043b\u0438 unit-\u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0442\u043e <code>lane<\/code> \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0445\u043e\u043c.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u043a\u0435\u0439\u0441\u0430\u043c.<\/p>\n<h4>\u0421\u0431\u043e\u0440\u043a\u0430 \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 Slack<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b QA \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0432\u0440\u0443\u0447\u043d\u0443\u044e (\u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043e\u043d\u0438 \u0443\u043c\u0435\u044e\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c) \u0438 \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0432 Slack.<\/p>\n<p>\u041d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0445 \u0441\u0431\u043e\u0440\u043e\u043a \u0434\u043b\u044f QA:<\/p>\n<pre><code class=\"ruby\">require 'fastlane'  require_relative 'building_slack'  # QA build methods module QABuild    def self.run(debug: false)     # \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0445\u0435\u043b\u043f\u0435\u0440 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 Slack-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439     thread = BuildingSlackThread.start( # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c \u0438\u0437 env-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432       ENV['SLACK_API_TOKEN'],       ENV['SLACK_QA_CHANNEL_BUILDS'],       'Building QA build...',       debug     )      begin       # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 APK-\u0444\u0430\u0439\u043b       Fastlane::Actions::GradleAction.run(           task: 'assemble',           flavor: '',           build_type: 'Release',           project_dir: \"..\/\",           print_command: true,           print_command_output: true       )  # \u0414\u043e\u0441\u0442\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 APK       completed_apk_path = Fastlane::Actions.lane_context[         Fastlane::Actions::SharedValues::GRADLE_APK_OUTPUT_PATH       ]  # \u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c APK-\u0444\u0430\u0439\u043b \u043a Slack-\u0442\u0440\u0435\u0434\u0443       thread.attach_file('APK file', completed_apk_path, 'app.apk')  # \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 AAB-\u0444\u0430\u0439\u043b       Fastlane::Actions::GradleAction.run(           task: 'bundle',           flavor: '',           build_type: 'Release',           project_dir: \"..\/\",           print_command: true,           print_command_output: true       )  # \u0414\u043e\u0441\u0442\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u043c\u0443 AAB       completed_aab_path = Fastlane::Actions.lane_context[         Fastlane::Actions::SharedValues::GRADLE_AAB_OUTPUT_PATH       ]        # \u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u043c AAB-\u0444\u0430\u0439\u043b \u043a Slack-\u0442\u0440\u0435\u0434\u0443       thread.attach_file('Bundle file', completed_aab_path, 'app.aab')        # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0440\u0435\u0434 - \u0441\u0431\u043e\u0440\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, # \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u0438\u0434\u0430\u0442\u044c \u0441\u043c\u0430\u0439\u043b\u043e\u0432       thread.success('Building QA build succeed')     rescue       # \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0440\u0435\u0434 - \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u043b\u0430\u0441\u044c, # \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u0438\u0434\u0430\u0442\u044c \u0441\u043c\u0430\u0439\u043b\u043e\u0432 \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438       thread.failure('Building QA build failed')       raise # \u043a\u0438\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0435\u0440\u0445 \u043a \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443     end   end end<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0434\u0435\u0442, \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043d\u0430\u043c \u0443\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c CI \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435. <\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 Slack<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c lane \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0435\u0440\u0441\u0438\u0439 \u0434\u043b\u044f QA: <\/p>\n<pre><code class=\"ruby\">desc 'Submit release builds to QA via Slack' lane :qa do   QABuild.run(debug: true) end<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c <code>fastlane qa<\/code><\/p>\n<h4>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 Play Store \u0441 \u0440\u0430\u0441\u043a\u0430\u0442\u043a\u043e\u0439 10%<\/h4>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0434\u043b\u044f QA, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 action-\u0430 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 Play Store &#8212; <code>Fastlane::Actions::UploadToPlayStoreAction<\/code> <\/p>\n<pre><code class=\"ruby\">require 'fastlane'  module Deploy   def self.run(debug: false)     thread = BuildingSlackThread.start(<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-370589","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=370589"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370589\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}