-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml
232 lines (207 loc) · 6.2 KB
/
config.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
---
cog_bundle_version: 4
name: heroku
version: 0.0.3
description: Manage heroku apps and organizations
long_description: |
This bundle provides functionality similar to the heroku toolbelt. In fact,
it actually uses the same underlying ruby library, so the data returned will
look familiar.
All commands will require credentials which can be provided by setting them
with dynamic config. You must set either HEROKU_API_KEY or both
HEROKU_USERNAME and HEROKU_PASSWORD.
author: Patrick Van Stee <patrick@operable.io>
homepage: https://github.com/cogcmd/heroku
docker:
image: cogcmd/heroku
tag: 0.0.3
permissions:
- heroku:read
- heroku:write
- heroku:admin
commands:
app:
executable: /home/bundle/cog-command
description: List and display info about apps
arguments: "[list | info <app>]"
subcommands:
list: List all apps (default)
"info <app>": Display details about an app
examples: |
List all apps:
heroku:app list
View details about a specific app:
heroku:app info frosty-mountain-7639
rules:
- must have heroku:read
config:
executable: /home/bundle/cog-command
description: List and modify environment variables for an app
arguments: "[list | set <name=value> | unset <name>]"
subcommands:
list: List all environment variables
set: Set an environment variable
unset: Unset an environment variable
examples: |
List all environment variables:
heroku:config --app frosty-mountain-7639
Set a new environment variable:
heroku:config set LOG_LEVEL=warn --app frosty-mountain-7639
Unset a new environment variable:
heroku:config unset DEBUG --app frosty-mountain-7639
rules:
- must have heroku:admin
- must have heroku:read
- with arg[0] == 'set' must have heroku:write
- with arg[0] == 'unset' must have heroku:write
options:
app:
type: string
required: true
ps:
executable: /home/bundle/cog-command
description: List and modify processes of an app
arguments: "[list | scale <dyno=amount> ... | restart <dyno>]"
subcommands:
list: List all processes (default)
"scale <dyno=amount> ...": Scale dynos to the specified amount
"restart <dyno>": Restart a dyno
examples: |
List all processes:
heroku:ps --app frosty-mountain-7639
Scale up the web and api processes:
heroku:ps scale web=4 api=8 --app frosty-mountain-7639
Restart the web.1 process:
heroku:ps restart web.1 --app frosty-mountain-7639
rules:
- must have heroku:read
- with arg[0] == 'scale' must have heroku:write
- with arg[0] == 'restart' must have heroku:write
options:
app:
type: string
required: true
release:
executable: /home/bundle/cog-command
description: List and rollback to older releases
arguments: "[list | info <release> | rollback <release>]"
subcommands:
list: List all releases
"info <release>": Display details about a release
"rollback <release>": Rollback the app to a previous release
examples: |
List all releases:
heroku:release list --app frosty-mountain-7639
Look at a release:
heroku:release info v285 --app frosty-mountain-7639
Rollback to an older release:
heroku:release rollback v284 --app frosty-mountain-7639
rules:
- must have heroku:read
- with arg[0] == 'rollback' must have heroku:write
options:
app:
type: string
required: true
user:
executable: /home/bundle/cog-command
description: List and manage organization membership
arguments: "[list | add <email> | remove <email>]"
subcommands:
list: List all users
"add <email>": Add user by email
"remove <email>": Remove user by email
examples: |
List all users:
heroku:user list --app frosty-mountain-7639
Add a new user:
heroku:user add matt@operable.io --app frosty-mountain-7639
Remove an existing user:
heroku:user add mark@operable.io --app frosty-mountain-7639
rules:
- must have heroku:read
- with arg[0] == 'add' must have heroku:write
- with arg[0] == 'remove' must have heroku:write
options:
app:
type: string
required: true
templates:
app_list:
body: |-
| Name | Owner |
| ---- | ----- |
~each var=$results~
| ~$item.name~ | ~$item.owner_email~ |
~end~
app_info:
body: |-
~if cond=length($results) == 1~
~each var=$results~
```
Dynos: ~$item.dynos~
Git URL: ~$item.git_url~
Owner: ~$item.owner_email~
Region: ~$item.region~
Repo Size: ~$item.repo_size~
Slug Size: ~$item.slug_size~
Stack: ~$item.stack~
Web URL: ~$item.web_url~
```
~end~
~end~
~if cond=length($results) > 1~
| Dynos | Git URL | Web URL |
| ----- | ------- | ------- |
~each var=$results~
| ~$item.dynos~ | ~$item.git_url~ | ~$item.web_url~ |
~end~
~end~
config_list:
body: |
| Key | Value |
| --- | ----- |
~each var=$results~
| ~$item.key~ | ~$item.value~ |
~end~
ps_list:
body: |
| Process | Command | State |
| ------- | ------- | ----- |
~each var=$results~
| ~$item.process~ | ~$item.command~ | ~$item.pretty_state~ |
~end~
release_list:
body: |
| Name | Description |
| ---- | ----------- |
~each var=$results~
| ~$item.name~ | ~$item.descr~ |
~end~
release_info:
body: |
~if cond=length($results) == 1~
~each var=$results~
```
Name: ~$item.name~
Description: ~$item.descr~
Released By: ~$item.user~
Released At: ~$item.created_at~
Commit: ~$item.commit~
```
~end~
~end~
~if cond=length($results) > 1~
| Name | Description |
| ---- | ----------- |
~each var=$results~
| ~$item.name~ | ~$item.descr~ |
~end~
~end~
user_list:
body: |
| Email | Role |
| ----- | ---- |
~each var=$results~
| ~$item.email~ | ~$item.role~ |
~end~