1

Useful Danger rules for Bitrise

 3 years ago
source link: https://www.jessesquires.com/blog/2020/12/20/useful-danger-rules-for-bitrise/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

20 Dec 2020

software-dev    bitrise, ci, danger

This is a quick follow-up to my previous post. The client project I’m working on is also using Bitrise for CI, which I must say is quite good. If you are looking for a hosted CI service I would highly recommend checking them out.

Anyway, if you are using Bitrise (and Danger), here are some convenient rules to add to your post-CI Danger run. These rules comment with the build number, a link to build logs, a link to Bitrise’s “Test Reports” feature, and a link to the install page of the internal build that was created by your pull request.

# Comment with build number
build_number = ENV['BITRISE_BUILD_NUMBER']
message("Build ##{build_number} completed.")

# Comment with link to build logs
build_url = ENV['BITRISE_BUILD_URL']
if build_url
    message("[Bitrise Build logs](#{build_url})")
end

# Comment with link to test reports
build_slug = ENV['BITRISE_BUILD_SLUG']
if build_slug
    message("[Bitrise Test Reports](https://addons-testing.bitrise.io/builds/#{build_slug}/summary)")
end

# Comment with link to public install page
public_install_page_url = ENV['BITRISE_PUBLIC_INSTALL_PAGE_URL']
if public_install_page_url
    message("[New app deployed to Bitrise](#{public_install_page_url})")
end

Altogether, this provides a nice summary for your pull request. It allows you to quickly find all of the various results for your build, and easily send a link to that build to product managers, QA testers, and designers who might wish to verify or test your changes. I’ve found this to be very convenient and helpful, especially on GitLab (also used by this client) which has a dramatically inferior web UI compared to GitHub.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK