Skip to content

Instantly share code, notes, and snippets.

@trmaphi
Created March 12, 2020 12:15
Show Gist options
  • Save trmaphi/fed508ccaab3da24885146ac7acf9ae5 to your computer and use it in GitHub Desktop.
Save trmaphi/fed508ccaab3da24885146ac7acf9ae5 to your computer and use it in GitHub Desktop.
Notify slack incoming webhooks about current deployment
#!/usr/bin/env bash
TARGET=$(git describe --dirty --broken --all --long);
PROJECT=$(git config remote.origin.url |sed 's#.*\/\(.*\)\.git#\1#');
git pull && \
curl -i \
-H "Content-Type:application/json" \
-X POST \
-d "{\"text\": \"deployed \`${PROJECT}\` \`$TARGET\` to \`$1\` \"}" \
$WEBHOOK_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment