Skip to content

Instantly share code, notes, and snippets.

@fhunleth
Created April 26, 2019 13:15
Show Gist options
  • Save fhunleth/e3da16a9685a897d23b33f4c17378c77 to your computer and use it in GitHub Desktop.
Save fhunleth/e3da16a9685a897d23b33f4c17378c77 to your computer and use it in GitHub Desktop.
fwup metadata to slack
./jq-linux64 -n \
--arg meta_uuid $(grep 'meta-uuid' <<< $FW_META | awk -F"=" '{ print $2}') \
--arg meta_version "$(grep 'meta-version' <<< $FW_META | awk -F"=" '{ print $2}')" \
--arg meta_vcs_identifier "$(grep 'meta-vcs-identifier' <<< $FW_META | awk -F"=" '{ print $2}')" \
--arg meta_platform "$(grep 'meta-platform' <<< $FW_META | awk -F"=" '{ print $2}')" \
--arg meta_creation_date "$(grep 'meta-creation-date' <<< $FW_META | awk -F"=" '{ print $2}')" \
--arg meta_misc "$(grep 'meta-misc' <<< $FW_META | awk -F"=" '{ print $2}')" \
'{channel: "C41SHHGQ5", as_user: true, blocks: [
{type: "section", block_id: "text1", text: {type: "mrkdwn", text: "*A new FarmBot Firmware is available*"}},
{type: "context", elements: [
{type: "mrkdwn", text: "*UUID:*"},
{type: "mrkdwn", text: $meta_uuid}
]},
{type: "context", elements: [
{type: "mrkdwn", text: "*Version:*"},
{type: "mrkdwn", text: $meta_version}
]},
{type: "context", elements: [
{type: "mrkdwn", text: "*Git ID:*"},
{type: "mrkdwn", text: $meta_vcs_identifier}
]},
{type: "context", elements: [
{type: "mrkdwn", text: "*Misc:*"},
{type: "mrkdwn", text: $meta_misc}
]},
{type: "context", elements: [
{type: "mrkdwn", text: "*Platform:*"},
{type: "mrkdwn", text: $meta_platform}
]},
{type: "context", elements: [
{type: "mrkdwn", text: "*Creation Date:*"},
{type: "mrkdwn", text: $meta_creation_date}
]}
]}'
@fhunleth
Copy link
Author

This is from Connor Rigby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment