Artifacts Class
Artifacts definition for a CodeBuild Project.
| Source | aws-codebuild/lib/artifacts.ts |
|---|
Example
ts
declare const bucket: s3.Bucket;
const project = new codebuild.Project(this, 'MyProject', {
buildSpec: codebuild.BuildSpec.fromObject({
version: '0.2',
}),
artifacts: codebuild.Artifacts.s3({
bucket,
includeBuildId: false,
packageZip: true,
path: 'another/path',
identifier: 'AddArtifact1',
}),
});
java
Bucket bucket;
Project project = Project.Builder.create(this, "MyProject")
.buildSpec(BuildSpec.fromObject(Map.of(
"version", "0.2")))
.artifacts(Artifacts.s3(S3ArtifactsProps.builder()
.bucket(bucket)
.includeBuildId(false)
.packageZip(true)
.path("another/path")
.identifier("AddArtifact1")
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Bucket bucket;
var project = new Project(this, "MyProject", new ProjectProps {
BuildSpec = BuildSpec.FromObject(new Dictionary<string, object> {
{ "version", "0.2" }
}),
Artifacts = Artifacts.S3(new S3ArtifactsProps {
Bucket = bucket,
IncludeBuildId = false,
PackageZip = true,
Path = "another/path",
Identifier = "AddArtifact1"
})
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var bucket Bucket
project := codebuild.NewProject(this, jsii.String("MyProject"), &ProjectProps{
BuildSpec: codebuild.BuildSpec_FromObject(map[string]interface{}{
"version": jsii.String("0.2"),
}),
Artifacts: codebuild.Artifacts_S3(&S3ArtifactsProps{
Bucket: *Bucket,
IncludeBuildId: jsii.Boolean(false),
PackageZip: jsii.Boolean(true),
Path: jsii.String("another/path"),
Identifier: jsii.String("AddArtifact1"),
}),
})
Properties
identifiermay be undefinedstringidentifiermay be undefinedstridentifiermay be undefinedStringIdentifiermay be undefinedstringIdentifiermay be undefined*string #The artifact identifier.
This property is required on secondary artifacts.
The CodeBuild type of this artifact.
Methods
bind(_scope: Construct, _project: IProject): ArtifactsConfigdef bind(self, _scope: Construct, _project: IProject) -> ArtifactsConfigpublic ArtifactsConfig bind(Construct _scope, IProject _project)public ArtifactsConfig Bind(Construct _scope, IProject _project)func Bind(_scope Construct, _project IProject) ArtifactsConfig #Callback when an Artifacts class is used in a CodeBuild Project.
s3(props: S3ArtifactsProps): IArtifacts@staticmethod def s3(props: S3ArtifactsProps) -> IArtifactspublic static IArtifacts s3(S3ArtifactsProps props)public static IArtifacts S3(S3ArtifactsProps props)func S3(Props S3ArtifactsProps) IArtifacts static #