Link

Installation

Burnout Barometer is easy-to-configure and deployable as a serverless application.

Assuming that you already know how to create a Slack App, this page will walk you through on how to set-up your Barometer, then show various deployment options at your disposal.


Table of contents

  1. Initial Setup
  2. Deployment Options
    1. Deploy via Google Cloud Functions
    2. Deploy via Google Cloud Run

Initial Setup

  1. Download the executable. Ensure that you have downloaded the barometer executable. Follow the download instructions for more info.
  2. Initialize configuration. Run barometer init. Answer a series of prompts to configure your Barometer. The following config options need to be set:

    Option Docker Env Var Description
    Table BB_TABLE The database connection URL to store Barometer logs. For Bigquery, use the bq protocol like so: bq://my-gcp-project.my-dataset.my-table
    Slack Token BB_SLACK_TOKEN The Slack Token generated whenever you create an App. This is used to verify that the incoming request came from the authorized account. See this page for more information
    Area BB_AREA The IANA compliant area for correcting the timezone. For example, Asia/Manila.
    Twitter Consumer Key BB_TWITTER_CONSUMER_KEY (Optional) Your Twitter Consumer Key to fetch Tweets from tinycarebot. Check this link for details
    Twitter Consumer Secret BB_TWITTER_CONSUMER_SECRET (Optional) Your Twitter Consumer Secret to fetch Tweets from tinycarebot. Check this link for details
    Twitter Access Key BB_TWITTER_ACCESS_KEY (Optional) Your Twitter Access Key to fetch Tweets from tinycarebot. Check this link for details
    Twitter Access Secret BB_TWITTER_ACCESS_SECRET (Optional) Your Twitter Access Secret to fetch Tweets from tinycarebot. Check this link for details

    You can find more information about the init command by running barometer init --help.

  3. Check if a config file has been generated. After running the init command, you should see a config.json file with your configuration. We will use this later on when deploying or starting the server.

Deployment Options

Burnout Barometer is a server-side application, and can be deployed by various means. You can also check out our Docker image located in the Azure Container Registry.

Deploy via Google Cloud Functions

To deploy via Google Cloud Functions, clone the Github repository to access the function/ directory:

git clone git@github.com:ljvmiranda921/burnout-barometer.git

Copy over the config.json that you’ve generated before into this path:

cp path/of/config.json function/

Lastly, head to the function/ directory and execute the Cloud Function deploy command:

cd function/
gcloud functions deploy BurnoutBarometerFn --runtime go111 --triger-http

Once successful, Cloud Functions will provide you a URL that you can now add in your Slack Application’s Slash command.

Deploy via Google Cloud Run

You can deploy to Google Cloud Run using the ljvmiranda.azurecr.io/burnout-barometer Docker image. You need to set some environment variables to configure the barometer:

To deploy, run the following command:

gcloud beta run deploy burnout-barometer \
    --image ljvmiranda.azurecr.io/burnout-barometer \
    --set-env-vars=BB_PROJECT_ID=<PROJECT_ID>,BB_TABLE=<TABLE>,BB_SLACK_TOKEN=<TOKEN>,BB_AREA=<AREA>

Or better yet, just click the button below:

Run on Google Cloud


Now that you have configured and deployed your barometer, check-out the Usage Section to learn more about this tool!