@Generated(value="jsii-pacmak/1.77.0 (build 3e5fa88)", date="2023-03-14T15:04:57.927Z") @Stability(value=Stable) public abstract class BuildSpec extends software.amazon.jsii.JsiiObject
Example:
import software.amazon.awscdk.services.codebuild.*;
Project codebuildProject = Project.Builder.create(this, "Project")
.projectName("MyTestProject")
.buildSpec(BuildSpec.fromObject(Map.of(
"version", "0.2",
"phases", Map.of(
"build", Map.of(
"commands", List.of("echo \"Hello, CodeBuild!\""))))))
.build();
CodeBuildStartBuild task = CodeBuildStartBuild.Builder.create(this, "Task")
.project(codebuildProject)
.integrationPattern(IntegrationPattern.RUN_JOB)
.environmentVariablesOverride(Map.of(
"ZONE", BuildEnvironmentVariable.builder()
.type(BuildEnvironmentVariableType.PLAINTEXT)
.value(JsonPath.stringAt("$.envVariables.zone"))
.build()))
.build();
| Modifier | Constructor and Description |
|---|---|
protected |
BuildSpec() |
protected |
BuildSpec(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
BuildSpec(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static BuildSpec |
fromAsset(String path)
Use the contents of a local file as the build spec string.
|
static BuildSpec |
fromObject(Map<String,? extends Object> value) |
static BuildSpec |
fromObjectToYaml(Map<String,? extends Object> value)
Create a buildspec from an object that will be rendered as YAML in the resulting CloudFormation template.
|
static BuildSpec |
fromSourceFilename(String filename)
Use a file from the source as buildspec.
|
abstract Boolean |
getIsImmediate()
Whether the buildspec is directly available or deferred until build-time.
|
abstract String |
toBuildSpec()
Render the represented BuildSpec.
|
abstract String |
toBuildSpec(software.constructs.Construct scope)
Render the represented BuildSpec.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected BuildSpec(software.amazon.jsii.JsiiObjectRef objRef)
protected BuildSpec(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) protected BuildSpec()
@Stability(value=Stable) @NotNull public static BuildSpec fromAsset(@NotNull String path)
Use this if you have a local .yml or .json file that you want to use as the buildspec
path - This parameter is required.@Stability(value=Stable) @NotNull public static BuildSpec fromObject(@NotNull Map<String,? extends Object> value)
value - This parameter is required.@Stability(value=Stable) @NotNull public static BuildSpec fromObjectToYaml(@NotNull Map<String,? extends Object> value)
value - the object containing the buildspec that will be rendered as YAML. This parameter is required.@Stability(value=Stable) @NotNull public static BuildSpec fromSourceFilename(@NotNull String filename)
Use this if you want to use a file different from 'buildspec.yml'`
filename - This parameter is required.@Stability(value=Stable) @NotNull public abstract String toBuildSpec(@Nullable software.constructs.Construct scope)
scope - @Stability(value=Stable) @NotNull public abstract String toBuildSpec()
@Stability(value=Stable) @NotNull public abstract Boolean getIsImmediate()
Copyright © 2023. All rights reserved.