| 1 | import type * as SVC from "@distilled.cloud/aws/codebuild"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Project } from "./Project.ts"; |
| 5 | |
| 6 | export interface StartBuildRequest extends Omit< |
| 7 | SVC.StartBuildInput, |
| 8 | "projectName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `codebuild:StartBuild` — lets a workload kick off a |
| 13 | * build of a CodeBuild project (optionally overriding the source version, |
| 14 | * environment variables, buildspec, etc.). |
| 15 | * |
| 16 | * The response carries the created `build` including its `id`, which can be |
| 17 | * polled with the {@link BatchGetBuilds} binding. |
| 18 | * ### Starting Builds |
| 19 | * **Example:** Start a Build |
| 20 | * ```typescript |
| 21 | * const startBuild = yield* AWS.CodeBuild.StartBuild(project); |
| 22 | * |
| 23 | * const { build } = yield* startBuild({ |
| 24 | * environmentVariablesOverride: [ |
| 25 | * { name: "COMMIT", value: sha, type: "PLAINTEXT" }, |
| 26 | * ], |
| 27 | * }); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface StartBuild extends Binding.Service< |
| 33 | StartBuild, |
| 34 | "AWS.CodeBuild.StartBuild", |
| 35 | <P extends Project>( |
| 36 | project: P, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request?: StartBuildRequest, |
| 40 | ) => Effect.Effect<SVC.StartBuildOutput, SVC.StartBuildError> |
| 41 | > |
| 42 | > {} |
| 43 | export const StartBuild = Binding.Service<StartBuild>( |
| 44 | "AWS.CodeBuild.StartBuild", |
| 45 | ); |