Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

DavyJ0nes/meetspaceBot

Repository files navigation

Go Report Card

                        __                             ____        __ 
   ____ ___  ___  ___  / /__________  ____ _________  / __ )____  / /_
  / __ `__ \/ _ \/ _ \/ __/ ___/ __ \/ __ `/ ___/ _ \/ __  / __ \/ __/
 / / / / / /  __/  __/ /_(__  ) /_/ / /_/ / /__/  __/ /_/ / /_/ / /_  
/_/ /_/ /_/\___/\___/\__/____/ .___/\__,_/\___/\___/_____/\____/\__/  
                            /_/                                       

Overview

This is a simple bot that links Hipchat with Meetspace Video chat

This is my first attempt at writing a non-trivial GO program as well as using Docker for deployment.

The deployment artifact is a GO binary that is run from a docker container. To help keep the container size to a minimum I'm using a statically linked binary by disabling cgo and rebuilding all dependencies as well with cgo disabled. I would have used "FROM scratch" but needed environment variables. More Infomation

If you want to run it outside of Docker, then within Releases there is the latest stable go binary that is compiled to run on Linux.

Usage

Run in Docker

You can run in Docker with:

docker run -p 80:8081 -d --name msb-1 -e HIPCHAT_API_TOKEN="" -e MEETSPACE_API_TOKEN="" davyj0nes/meetspacebot"

There is also a helper script for running on remote machine. For testing I am just using a basic AWS EC2 instance with Docker installed.

How to deploy with script

  1. Declare Environment variables or change in deploy script
  2. Run ./deploy deploy

Set up in Hipchat

Please follow this guide: https://blog.hipchat.com/2015/02/11/build-your-own-integration-with-hipchat/

  • For the Slash command, it needs to be set as "/meetspace"
  • For the url, it needs to follow this schema: "/api/v0/hipchat"

Run Demo Meetspace API Server

To help with development while the Meetspace API is being added, there is a simple static version of the return data. To run if you can use the following:

sudo docker run --restart=unless-stopped -p 8080:8080 -d --name demo-api davyj0nes/meetspacedemoapi

Use of Environment Variables

The Bot requires the following environment variables to be set:

  • HIPCHAT_API_TOKEN - This is the Hipchat API token. You can generate one from here
  • MEETSPACE_API_TOKEN - This is the API token for meetspace.
  • MEETSPACE_API_HOST - host of the Meetspace API. When running Demo API, this will need to be changed.
  • MEETSPACEBOT_TEST - Set to "true" if you want to use local Demo API Container

Roadmap

This package was made for personal use but would like to add the following in the future. Any contributions are welcome - Just open a PR.

  • Use docker compose/swarm or Kubernetes for deployment rather than bash script
  • Post message's as Cards
  • Slack Support
  • Deeper integration with HipChat and Slack

License

This package is distributed under the BSD-style license found in the LICENSE file.

Releases

No releases published

Packages

No packages published