hubot-cloud66
Hubot for Cloud66
Last updated a year ago by taufek .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hubot-cloud66 
SYNC missed versions from official npm registry.

hubot-cloud66

Codacy Badge CircleCI

Hubot for Cloud66

See src/cloud66.coffee for full documentation.

Requirements

package version
coffeescript >= 1.9

Installation

In hubot project repo, run:

npm install hubot-cloud66 --save

Then add hubot-cloud66 to your external-scripts.json:

[
  "hubot-cloud66"
]

Environment Variables

CLOUD66_ACCESS_TOKEN = Cloud66 personal access token. Go to Cloud66 personal tokens page to generate one.

CLOUD66_DELAY_IN_MS - Delay in millisecond before start polling Cloud66 for Stack status update after running redeploy.

CLOUD66_INTERVAL_IN_MS - Interval in millisecond between polling requests for Cloud66 Stack status update.

CLOUD66_MAX_ATTEMPTS - Maximum attempts to poll Cloud66 for Stack status update.

CLOUD66_ENABLE_SLACK_CALLBACK - Enable Slack callback for interactive buttons. You will need to configure your Slack app with callback url.

Commands

Stack Deployment Info

Stack latest deployment info for given environment and stack name.

user1>> hubot cloud66 deployment development backend_app
hubot>> Here is the latest deployment commit hash for development backend_app
hubot>> Commit https://github.com/taufek/backend_app/commit/5675fcd8f9e6dc534ecf1410c0661c066097e310

Stacks List

Display all available stacks.

user1>> hubot cloud66 stacks
hubot>>
frontend_app (env: development, uid: abc-123)
backend_app (env: development, uid: abc-345)
user app (env: development, uid: abc-456)

Stack Info/Status

Stack current info for given environment and stack name.

user1>> hubot cloud66 stack development backend_app
hubot>> development backend_app status: Live ????

Stack Redeployment

Redeploy given environment and stack name.

user1>> hubot cloud66 redeploy development backend_app
hubot>> Stack queued for redeployment
hubot>> development backend_app status: Deploying ????️
... few minutes later
hubot>> development backend_app status: Live ????

Alias

c66 is an alias for cloud66, so you could also run below

user1>> hubot c66 stack development backend_app
hubot>> development backend_app status: Live ????

Slack Integration

Message Output

Stack output with Slack callback disabled

Stack Output without callback

Stack output with Slack callback enabled

Stack Output with callback

Enabling Slack Callback

Set CLOUD66_ENABLE_SLACK_CALLBACK environment variable to true.

Then in your Slack App setup configure your action callback url to point to hubot-cloud66 endpoint.

Stack callback url

If your hubot already has a router, you can set the action callback url to your existing endpoint and redirect any post request with Slack callback_id that starts with cloud66 to /hubot/cloud66.

Below is an example code of hubot router with /hubot/slack endpoint that redirects request to /hubot/cloud66 endpoint.

http = require('http')

module.exports = (robot) ->
  robot.router.post '/hubot/slack', (request, response) ->
    data = if request.body.payload? then JSON.parse request.body.payload else request.body

    if data.callback_id.startsWith 'cloud66'
      options = {
        host: request.headers.host,
        path: '/hubot/cloud66',
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Content-Length': JSON.stringify(data).length
        }
      }

    req = http.request options, (res) =>
      res.on 'data', (d) =>
        response.send(d)

    req.on 'error', (error) =>
      console.error(error)

    req.write JSON.stringify(data)
    req.end

NPM Module

NPM module page

Current Tags

  • 0.2.3                                ...           latest (a year ago)

31 Versions

  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.26                                ...           a year ago
  • 0.0.25                                ...           a year ago
  • 0.0.24                                ...           a year ago
  • 0.0.23                                ...           a year ago
  • 0.0.22                                ...           a year ago
  • 0.0.21                                ...           a year ago
  • 0.0.20                                ...           a year ago
  • 0.0.19                                ...           a year ago
  • 0.0.18                                ...           a year ago
  • 0.0.17                                ...           a year ago
  • 0.0.16                                ...           a year ago
  • 0.0.15                                ...           a year ago
  • 0.0.14                                ...           a year ago
  • 0.0.13                                ...           a year ago
  • 0.0.12                                ...           a year ago
  • 0.0.11                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 31
Dependencies (2)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |