(opts = {})
| 162 | } |
| 163 | |
| 164 | async registerRunner(opts = {}) { |
| 165 | const { tags, name } = opts; |
| 166 | |
| 167 | const endpoint = `/runners`; |
| 168 | const body = new URLSearchParams(); |
| 169 | body.append('description', name); |
| 170 | body.append('tag_list', tags); |
| 171 | body.append('locked', 'true'); |
| 172 | body.append('run_untagged', 'true'); |
| 173 | body.append('access_level', 'not_protected'); |
| 174 | |
| 175 | const token = await this.runnerToken(new URLSearchParams(body)); |
| 176 | if (token.startsWith('glrt-')) return { token }; |
| 177 | |
| 178 | body.append('token', token); |
| 179 | return await this.request({ endpoint, method: 'POST', body }); |
| 180 | } |
| 181 | |
| 182 | async unregisterRunner(opts = {}) { |
| 183 | const { runnerId } = opts; |
no test coverage detected