aws-cdk-lib.aws_codebuild.GitHubEnterpriseSourceProps

interface GitHubEnterpriseSourceProps

LanguageType name
.NETAmazon.CDK.AWS.CodeBuild.GitHubEnterpriseSourceProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#GitHubEnterpriseSourceProps
Javasoftware.amazon.awscdk.services.codebuild.GitHubEnterpriseSourceProps
Pythonaws_cdk.aws_codebuild.GitHubEnterpriseSourceProps
TypeScript (source)aws-cdk-lib » aws_codebuild » GitHubEnterpriseSourceProps

Construction properties for GitHubEnterpriseSource.

Example

new codebuild.Project(this, 'Project', {
  source: codebuild.Source.gitHubEnterprise({
    httpsCloneUrl: 'https://my-github-enterprise.com/owner/repo',
  }),

  // Enable Docker AND custom caching
  cache: codebuild.Cache.local(codebuild.LocalCacheMode.DOCKER_LAYER, codebuild.LocalCacheMode.CUSTOM),

  // BuildSpec with a 'cache' section necessary for 'CUSTOM' caching. This can
  // also come from 'buildspec.yml' in your source.
  buildSpec: codebuild.BuildSpec.fromObject({
    version: '0.2',
    phases: {
      build: {
        commands: ['...'],
      },
    },
    cache: {
      paths: [
        // The '**/*' is required to indicate all files in this directory
        '/root/cachedir/**/*',
      ],
    },
  }),
});

Properties

NameTypeDescription
httpsCloneUrlstringThe HTTPS URL of the repository in your GitHub Enterprise installation.
branchOrRef?stringThe commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build.
buildStatusContext?stringThis parameter is used for the context parameter in the GitHub commit status.
buildStatusUrl?stringThe URL that the build will report back to the source provider.
cloneDepth?numberThe depth of history to download.
fetchSubmodules?booleanWhether to fetch submodules while cloning git repo.
identifier?stringThe source identifier.
ignoreSslErrors?booleanWhether to ignore SSL errors when connecting to the repository.
reportBuildStatus?booleanWhether to send notifications on your build's start and end.
webhook?booleanWhether to create a webhook that will trigger a build every time an event happens in the repository.
webhookFilters?FilterGroup[]A list of webhook filters that can constraint what events in the repository will trigger a build.
webhookTriggersBatchBuild?booleanTrigger a batch build from a webhook instead of a standard one.

httpsCloneUrl

Type: string

The HTTPS URL of the repository in your GitHub Enterprise installation.


branchOrRef?

Type: string (optional, default: the default branch's HEAD commit ID is used)

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

'mybranch'

buildStatusContext?

Type: string (optional, default: "AWS CodeBuild $AWS_REGION ($PROJECT_NAME)")

This parameter is used for the context parameter in the GitHub commit status.

Can use built-in CodeBuild variables, like $AWS_REGION.

See also: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html Example

"My build #$CODEBUILD_BUILD_NUMBER"

buildStatusUrl?

Type: string (optional, default: link to the AWS Console for CodeBuild to a particular build execution)

The URL that the build will report back to the source provider.

Can use built-in CodeBuild variables, like $AWS_REGION.

See also: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html Example

"$CODEBUILD_PUBLIC_BUILD_URL"

cloneDepth?

Type: number (optional)

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.


fetchSubmodules?

Type: boolean (optional, default: false)

Whether to fetch submodules while cloning git repo.


identifier?

Type: string (optional)

The source identifier.

This property is required on secondary sources.


ignoreSslErrors?

Type: boolean (optional, default: false)

Whether to ignore SSL errors when connecting to the repository.


reportBuildStatus?

Type: boolean (optional, default: true)

Whether to send notifications on your build's start and end.


webhook?

Type: boolean (optional, default: true if any webhookFilters were provided, false otherwise)

Whether to create a webhook that will trigger a build every time an event happens in the repository.


webhookFilters?

Type: FilterGroup[] (optional, default: every push and every Pull Request (create or update) triggers a build)

A list of webhook filters that can constraint what events in the repository will trigger a build.

A build is triggered if any of the provided filter groups match. Only valid if webhook was not provided as false.


webhookTriggersBatchBuild?

Type: boolean (optional, default: false)

Trigger a batch build from a webhook instead of a standard one.

Enabling this will enable batch builds on the CodeBuild project.