Skip to content

Instantly share code, notes, and snippets.

@mochja
Last active April 24, 2017 12:38
Show Gist options
  • Save mochja/78c7fb01e2a2d1cc1cbe013e212cb5b4 to your computer and use it in GitHub Desktop.
Save mochja/78c7fb01e2a2d1cc1cbe013e212cb5b4 to your computer and use it in GitHub Desktop.
#!/bin/bash
timestamp=`date +%Y%m%d-%H%I%S`
name="artifacts-$timestamp.zip"
channels="#dev"
url="https://slack.com/api/files.upload"
zip -r "$name" . || exit 0
curl -F file=@"$name" \
-F filename="$name" \
-F channels="$channels" \
-F initial_comment="$CI_BUILD_URL $CI_MESSAGE" \
-F token="$SLACK_TOKEN" \
$url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment