mirror of
https://github.com/openstf/stf
synced 2025-10-03 17:59:28 +02:00
Add HipChat notifier role.
This commit is contained in:
parent
07f611b361
commit
4cf3d242a5
7 changed files with 134 additions and 1 deletions
39
lib/cli.js
39
lib/cli.js
|
@ -237,6 +237,45 @@ program
|
|||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('notify-hipchat')
|
||||
.description('start HipChat notifier')
|
||||
.option('-t, --token <token>'
|
||||
, 'HipChat v2 API token (or $HIPCHAT_TOKEN)'
|
||||
, String
|
||||
, process.env.HIPCHAT_TOKEN)
|
||||
.option('-r, --room <room>'
|
||||
, 'HipChat room (or $HIPCHAT_ROOM)'
|
||||
, String
|
||||
, process.env.HIPCHAT_ROOM)
|
||||
.option('-p, --priority <level>'
|
||||
, 'minimum log level'
|
||||
, Number
|
||||
, logger.Level.WARNING)
|
||||
.option('-s, --connect-sub <endpoint>'
|
||||
, 'sub endpoint'
|
||||
, cliutil.list)
|
||||
.action(function(options) {
|
||||
if (!options.token) {
|
||||
this.missingArgument('--token')
|
||||
}
|
||||
if (!options.room) {
|
||||
this.missingArgument('--room')
|
||||
}
|
||||
if (!options.connectSub) {
|
||||
this.missingArgument('--connect-sub')
|
||||
}
|
||||
|
||||
require('./roles/notify/hipchat')({
|
||||
token: options.token
|
||||
, room: options.room
|
||||
, priority: options.priority
|
||||
, endpoints: {
|
||||
sub: options.connectSub
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('app')
|
||||
.description('start app')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue