We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
For anyone still struggling with outputing useful info for non technical staff:
https://i.imgur.com/h0l2K9U.jpg
Snippet to add to the custom messaging class:
def payload_for_updated { attachments: [ { color: 'good', title: "#{deployer} deployed #{application} to #{stage}", fields: [ { title: 'Project', value: application, short: true }, { title: 'Environment', value: stage, short: true } ].tap do |fields| if revisions_present? fields << { title: 'Log', value: git_log, short: false } end end, fallback: super[:text] }.tap do |attachment| attachment[:title_link] = deployed_link if revisions_present? end ] } end # Open3 used for safe capturing when passing ruby variables to the command def git_log return unless revisions_present? output, _status = Open3.capture2e 'git', 'log', '--no-decorate', '--oneline', '--format=format:%s', "^#{previous_revision}", current_revision output.strip end def deployed_link return unless revisions_present? "https://github.com/YOUR_ORG/YOUR_APP/compare/#{CGI.escape(previous_revision)}...#{CGI.escape(current_revision)}" end def revisions_present? current_revision && previous_revision end def current_revision fetch :current_revision end def previous_revision fetch :previous_revision end
The text was updated successfully, but these errors were encountered:
In git_log you can even do this to make it even prettier
def git_log return unless revisions_present? output, _status = Open3.capture2e 'git', '--no-pager', 'log', '--no-merges', '--pretty=', '--format=format:%ad - *%s*%d -- _%an_', '--date-order', '--date=iso', "^#{previous_revision}", current_revision if output.empty? 'No commits (empty deploy)' else output.strip end end
Sorry, something went wrong.
No branches or pull requests
Hi,
For anyone still struggling with outputing useful info for non technical staff:
https://i.imgur.com/h0l2K9U.jpg
Snippet to add to the custom messaging class:
The text was updated successfully, but these errors were encountered: