1 | |
2 | |
3 | * Deploy helm |
4 | * You must provide a git commit id or a helm version depending on the source location of your code (git vs helm repository). |
5 | */ |
6 | export async function main( |
7 | auth: RT.Qovery, |
8 | helmId: string, |
9 | body: Body, |
10 | forceEvent?: 'DIFF' | undefined |
11 | ) { |
12 | const url = new URL(`https://api.qovery.com/helm/${helmId}/deploy`) |
13 | for (const [k, v] of [['forceEvent', forceEvent]]) { |
14 | if (v !== undefined && v !== '') { |
15 | url.searchParams.append(k, v) |
16 | } |
17 | } |
18 | const response = await fetch(url, { |
19 | method: 'POST', |
20 | headers: { |
21 | 'Content-Type': 'application/json', |
22 | Authorization: 'Token ' + auth.apiKey |
23 | }, |
24 | body: JSON.stringify(body) |
25 | }) |
26 | if (!response.ok) { |
27 | const text = await response.text() |
28 | throw new Error(`${response.status} ${text}`) |
29 | } |
30 | return await response.json() |
31 | } |
32 |
|
33 | |
34 | |
35 | * This file was automatically generated by json-schema-to-typescript. |
36 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
37 | * and run json-schema-to-typescript to regenerate this file. |
38 | */ |
39 |
|
40 | export interface Body { |
41 | |
42 | * version of the chart to deploy. |
43 | * Cannot be set if `git_commit_id` is defined |
44 | * |
45 | */ |
46 | chart_version?: string |
47 | |
48 | * Commit to deploy for chart source. |
49 | * Cannot be set if `version` is defined |
50 | * |
51 | */ |
52 | git_commit_id?: string |
53 | |
54 | * Commit to deploy for values override |
55 | * |
56 | */ |
57 | values_override_git_commit_id?: string |
58 | [k: string]: unknown |
59 | } |
60 |
|