Friday, Friday. Gotta get down on Friday

A few of you might have spotted this via the Octopus Deploy June newsletter.

Friday

You might be wondering how it’s done, as at least one person has requested via Twitter. Well wait no longer. Here’s how it’s done.

What you’re looking at is a Slack notification from Octopus Deploy, featuring a little image that’s been doing the rounds on Twitter. It exists already as a Capistrano template, and I figured it wouldn’t be too hard to do in Octopus.

I was going to go with the ASCII art  version, but after some struggles with Unicode transmission to Slack via webhooks, I decided to use the image directly. Life is too short to mess around with encoding all day.

I cracked open our existing Slack Deployment Notification step template (available from the Octopus Library), and added a snippet to detect if it’s Friday, and if we’re going to production

Because I wasn’t being super-fastidious about my code, I simply created an entirely new $payload object, with an image_url property under attachments, pointing to the PNG image hosted over at tech.domain.com.au.

If I was being a little more anal-retentive about my code, I’d probably have appended it to the existing $payload object using Add-Member, or perhaps added a different image for a not-Friday deploy. But this isn’t exactly what you’d call a critical function. Maybe later I’ll clean it up.

And as Octopus Deploy’s library step template is open-source, I present here the adapted version in full, for your delectation. You’ll also note, if you’re observant, that our version is modified to show which user did a deployment, not just that it happens. We run a no-blame DevOps ship, but it does help to know who to talk to if there’s a problem.

Happy deployments, and may all your Friday deploys be clean, successful and error-free.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">