-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.ts
More file actions
45 lines (42 loc) · 1.01 KB
/
deploy.ts
File metadata and controls
45 lines (42 loc) · 1.01 KB
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
import { getInput, setFailed, setOutput } from "@actions/core";
import { getBool, makeClient, parseDeployOutput } from "./lib.js";
interface Inputs {
project: string;
environment: string;
capsule: string;
build: string;
dryRun: boolean;
force: boolean;
}
async function action(inputs: Inputs) {
const client = await makeClient();
let resp = await client.capsule.deploy({
projectId: inputs.project,
environmentId: inputs.environment,
capsuleId: inputs.capsule,
dryRun: inputs.dryRun,
force: inputs.force,
changes: [
{
field: {
case: "buildId",
value: inputs.build,
},
},
],
});
let output = parseDeployOutput(resp.resourceYaml);
setOutput("rolloutConfig", output);
}
try {
action({
project: getInput("project"),
environment: getInput("environment"),
capsule: getInput("capsule"),
build: getInput("build"),
dryRun: getBool("dryRun"),
force: getBool("force"),
});
} catch (e: any) {
setFailed(e.message);
}