GithubHelp home page GithubHelp logo

teammentor / tbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 2.0 321 KB

Code for TBot, with is based on hubot and used to automate TeamMentor deployments (and other dev tasks)

License: MIT License

Shell 1.14% CoffeeScript 98.33% Batchfile 0.52%

tbot's Introduction

Welcome to TBot

Tbot is based on Hubot (which you can read more about on the original README.md file

This TBot is in action with the Security Innovation Slack environment, so if you have access to it, say hi to tbot there

How to run TBot locally

Here is how to run locally and test it

  1. clone this repo using :
[email protected]:TeamMentor/TBot.git**

image

  1. open folder and install dependencies
cd TBot
npm install

image

image

  1. run using
bin/hubot

image

(note: you might need to press enter once, and locally , you can ignore that HUBOT_HEROKU_KEEPALIVE_URL message)

  1. ask tbot for help
tbot help

image

  1. ask tbot to open some doors :)
tbot open the house doors
tbot open the pod bay doors

image

Write a TBot script

Here is a simple way to write a custom TBot script

  1. open the repo in an editor (in this case using Atom) and open the example.coffee file

image

  1. make a simple change, like for example:
   robot.respond /tm head/i, (res) ->
     res.reply 'The current HEAD commits are:....'

image

  1. restart tbot and execute the new command
tbot tm head

image

  1. here is a better example of a more useful tbot command
require 'fluentnode'
request = require 'request'

module.exports = (robot) ->

   robot.respond /tm head/i, (res) ->
     options = {url : 'https://api.github.com/repos/TeamMentor/TM_4_0_Design/git/refs/heads/master', headers: { 'User-Agent': 'Tbot'}}

     request options, (error, response, body)->
      #console.log body.json_Pretty
      res.reply 'The current HEAD of TM Design is: ' + body.json_Parse().object.sha
  1. which when executed shows the current commit SHA value
tbot tm head

image

  1. once we have a script, the next step is to commit it, and push it to both origin and heroku repos

image

image

image

  1. After deployment to heroku the command will be available on Slack

... when directly chatting with tbot

image

... or in a channel when sending a message directly to tbot

image

tbot's People

Contributors

diniscruz avatar

Watchers

 avatar  avatar James Cloos avatar RomichG avatar Salle J. Ingle avatar

tbot's Issues

Usernames longer than 30 characters?

Using the email address as the username is our convention for other platforms & products, including TA. Some email addresses are easily over 30 characters and this limitation prevents consistently using the email address as the username.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.