Slack bot for integration with Pivotal Tracker.
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.
- Get your Slack bot token:
- Create your Slack app and add bot into it.
- Install your app to your workspace.
- Go to the Features -> OAuth & Permissions tab and copy Bot User OAuth
Access Token. This is your
SLACK_API_TOKEN
.
- 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
.
Just run our trucknet/pivotal-tracker-slack-bot:latest docker image providing SLACK_API_TOKEN
and PIVOTAL_API_TOKEN
env variables.
- Create
.env
file and put it in project's root folder. - 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
- 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.
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.
npm test
to launch all tests.
Unit tests should be near the file with .spec.ts
extension.
Integration tests should be in tests.
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.
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.