Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Run long-running commands in the background, and slack the result

License

Notifications You must be signed in to change notification settings

william-tran/slackme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

slackme

Hey slackers, tired of staring at your terminal to wait for a long running command to finish? Or forgetting to check that it finished, and wasting precious cycle time? Slack better, with slackme.

Dependencies

slackme is written in bash, and requires curl, jq, and the usual suspects.

Installation

  1. Create an Incoming Webhook Slack integration that points to you or a channel of your choice.
  2. Set the webhook url in an environment variable called SLACKME_INCOMING_WEBHOOK_URL, eg in your .bash_profile:
export SLACKME_INCOMING_WEBHOOK_URL=https://hooks.slack.com/services/XXXX/YYYY/ZZZZ
  1. add the slackme script to your PATH

Usage

It's a bit like nohup some-command with args & . slackme will trap SIGHUP and run the command in the background, so no need to & at the end, e.g.:

$ slackme ./gradlew runSomeReallyLongTests
saving output of ./gradlew runSomeReallyLongTests to /tmp/slackme.12345.tmp

Contol is given back immediately. You can watch the output of your command via the temp file. When the command is finished, you'll get a slack message in your private channel!

Hey @channel, command

./gradlew runSomeReallyLongTests

exited with status code 1.

Output saved to /tmp/slackme.12345.tmp, here are the last 3500 bytes:

...
fail!
fail!
fail!

BUILD FAILED

Total time: 30 mins 14.638 secs
Stopped 1 compiler daemon(s).
Received result Failure[value=org.gradle.initialization.Reported...

Including more than 3500 bytes of output seems to cause Slack to not pre format the output.

License

MIT License

About

Run long-running commands in the background, and slack the result

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages