-
Notifications
You must be signed in to change notification settings - Fork 227
/
Copy pathupdate.ts
36 lines (29 loc) · 939 Bytes
/
update.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import color from '@heroku-cli/color'
import {Command, flags} from '@heroku-cli/command'
import {StageCompletion} from '@heroku-cli/command/lib/completions'
import {ux} from '@oclif/core'
import {updateCoupling} from '../../lib/api'
export default class PipelinesUpdate extends Command {
static description = 'update the app\'s stage in a pipeline'
static examples = [
'$ heroku pipelines:update -s staging -a my-app',
]
static flags = {
app: flags.app({required: true}),
remote: flags.remote(),
stage: flags.string({
char: 's',
description: 'new stage of app',
completion: StageCompletion,
required: true,
}),
}
async run() {
const {flags} = await this.parse(PipelinesUpdate)
const app = flags.app
const stage = flags.stage
ux.action.start(`Changing ${color.app(app)} to ${stage}`)
await updateCoupling(this.heroku, app, stage)
ux.action.stop()
}
}