CodeCommitSourceProps

class aws_cdk.aws_codebuild.CodeCommitSourceProps(*, identifier=None, repository, branch_or_ref=None, clone_depth=None, fetch_submodules=None)

Bases: SourceProps

Construction properties for {@link CodeCommitSource}.

Parameters
  • identifier (Optional[str]) – The source identifier. This property is required on secondary sources.

  • repository (IRepository) –

  • branch_or_ref (Optional[str]) – The commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. Default: the default branch’s HEAD commit ID is used

  • clone_depth (Union[int, float, None]) – The depth of history to download. Minimum value is 0. If this value is 0, greater than 25, or not provided, then the full history is downloaded with each build of the project.

  • fetch_submodules (Optional[bool]) – Whether to fetch submodules while cloning git repo. Default: false

ExampleMetadata

infused

Example:

import aws_cdk.aws_codecommit as codecommit
# repo: codecommit.Repository
# bucket: s3.Bucket


project = codebuild.Project(self, "MyProject",
    secondary_sources=[
        codebuild.Source.code_commit(
            identifier="source2",
            repository=repo
        )
    ],
    secondary_artifacts=[
        codebuild.Artifacts.s3(
            identifier="artifact2",
            bucket=bucket,
            path="some/path",
            name="file.zip"
        )
    ]
)

Attributes

branch_or_ref

The commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build.

Default

the default branch’s HEAD commit ID is used

Example:

"mybranch"
clone_depth

The depth of history to download.

Minimum value is 0. If this value is 0, greater than 25, or not provided, then the full history is downloaded with each build of the project.

fetch_submodules

Whether to fetch submodules while cloning git repo.

Default

false

identifier

The source identifier.

This property is required on secondary sources.

repository