Sign inSign up

trucknet/pivotal-tracker-slack-bot

By trucknet

•Updated almost 8 years ago

A bot to unfurl pivotal tracker stories in Slack

Image
0

10K+

trucknet/pivotal-tracker-slack-bot repository overview

⁠Pivotal Tracker Slack Bot

Build Status Coverage Status code style: prettier

Slack⁠ bot for integration with Pivotal Tracker⁠.

⁠Overview

This Slack bot listens for messages with Pivotal story IDs(which look like #123456789), fetches appropriate stories from Pivotal Tracker and posts them as a nice message in Slack.

⁠Pre installation

  1. Get your Slack bot token:
  1. Get your Pivotal Tracker token:
  • Go to your profile⁠
  • Get your API token on the bottom of the page. This is your PIVOTAL_API_TOKEN.

⁠Installation

⁠With Docker image

Just run our trucknet/pivotal-tracker-slack-bot:latest⁠ docker image providing SLACK_API_TOKEN and PIVOTAL_API_TOKEN env variables.

⁠From source code
  1. Create .env file and put it in project's root folder.
  2. Paste your environment variables to this file. Your .env file should look something like this:
    SLACK_API_TOKEN=xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx
    PIVOTAL_API_TOKEN=aaaaaaaaaabbbbbbbbbbffffffffff00
    
  3. Run npm install and that's it.

Note: instead of creating .env file you can pass SLACK_API_TOKEN and PIVOTAL_API_TOKEN as Node.js env variables.

⁠Start

npm run build to build js
npm start to run the bot
npm run start:dev to watch for file changes and restart bot instance

Note: after the bot is installed and running you need to invite him as a member to your channel in Slack so that he can post new messages.

⁠Tests

npm test to launch all tests.

Unit tests should be near the file with .spec.ts extension. Integration tests should be in tests.

⁠Release

npm test patch/minor/major will start a release/ branch (using git flow), edit package.json (and lock) to update the version, commit, finish the release and push including all branches and tags.

⁠Deployment

You can use project's Dockerfile to build a Docker image.
There are helper npm scripts available in the project:
npm run docker - builds Docker image named pivotal and runs it inside a container also named pivotal.
npm run docker:clean - stops and removes pivotal Docker container, then removes pivotal Docker image.

Tag summary

Content type

Image

Digest

Size

376.1 MB

Last updated

almost 8 years ago

docker pull trucknet/pivotal-tracker-slack-bot