UNPKG

1.06 kBJavaScriptView Raw
1const cli = require('heroku-cli-util')
2const co = require('co')
3const RenderTestRuns = require('../../lib/render-test-runs')
4const Utils = require('../../lib/utils')
5
6function* run (context, heroku) {
7 const pipeline = yield Utils.getPipeline(context, heroku)
8 return yield RenderTestRuns.render(pipeline, { heroku, watch: context.flags.watch, json: context.flags.json })
9}
10
11const cmd = {
12 topic: 'ci',
13 wantsApp: true,
14 needsAuth: true,
15 description: 'show the most recent runs',
16 help: 'display the most recent CI runs for the given pipeline',
17 flags: [
18 {
19 name: 'pipeline',
20 char: 'p',
21 hasValue: true,
22 description: 'pipeline'
23 },
24 {
25 name: 'watch',
26 char: 'w',
27 hasValue: false,
28 description: 'keep running and watch for new and update tests'
29 },
30 {
31 name: 'json',
32 char: 'j',
33 hasValue: false,
34 description: 'output run info in json format'
35 }
36 ],
37 run: cli.command(co.wrap(run))
38}
39
40module.exports = [
41 cmd,
42 Object.assign({ command: 'list', hidden: true }, cmd)
43]