GitHubEnterpriseSourceProps Struct
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/**/*',
],
},
}),
});
codebuild.Project(self, "Project",
source=codebuild.Source.git_hub_enterprise(
https_clone_url="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.
build_spec=codebuild.BuildSpec.from_object({
"version": "0.2",
"phases": {
"build": {
"commands": ["..."]
}
},
"cache": {
"paths": ["/root/cachedir/**/*"
]
}
})
)
Project.Builder.create(this, "Project")
.source(Source.gitHubEnterprise(GitHubEnterpriseSourceProps.builder()
.httpsCloneUrl("https://my-github-enterprise.com/owner/repo")
.build()))
// Enable Docker AND custom caching
.cache(Cache.local(LocalCacheMode.DOCKER_LAYER, LocalCacheMode.CUSTOM))
// BuildSpec with a 'cache' section necessary for 'CUSTOM' caching. This can
// also come from 'buildspec.yml' in your source.
.buildSpec(BuildSpec.fromObject(Map.of(
"version", "0.2",
"phases", Map.of(
"build", Map.of(
"commands", List.of("..."))),
"cache", Map.of(
"paths", List.of("/root/cachedir/**/*")))))
.build();
// Install: dotnet add package Amazon.CDK.Lib
new Project(this, "Project", new ProjectProps {
Source = Source.GitHubEnterprise(new GitHubEnterpriseSourceProps {
HttpsCloneUrl = "https://my-github-enterprise.com/owner/repo"
}),
// Enable Docker AND custom caching
Cache = Cache.Local(LocalCacheMode.DOCKER_LAYER, LocalCacheMode.CUSTOM),
// BuildSpec with a 'cache' section necessary for 'CUSTOM' caching. This can
// also come from 'buildspec.yml' in your source.
BuildSpec = BuildSpec.FromObject(new Dictionary<string, object> {
{ "version", "0.2" },
{ "phases", new Dictionary<string, IDictionary<string, string[]>> {
{ "build", new Struct {
Commands = new [] { "..." }
} }
} },
{ "cache", new Dictionary<string, string[]> {
{ "paths", new [] { "/root/cachedir/**/*" } }
} }
})
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
codebuild.NewProject(this, jsii.String("Project"), &ProjectProps{
Source: codebuild.Source_GitHubEnterprise(&GitHubEnterpriseSourceProps{
HttpsCloneUrl: jsii.String("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(map[string]interface{}{
"version": jsii.String("0.2"),
"phases": map[string]map[string][]*string{
"build": map[string][]*string{
"commands": []*string{
jsii.String("..."),
},
},
},
"cache": map[string][]*string{
"paths": []*string{
jsii.String("/root/cachedir/**/*"),
},
},
}),
})
Properties
branchOrRefoptionalstringbranch_or_refoptionalstrbranchOrRefoptionalStringBranchOrRefoptionalstringBranchOrRefoptional*string#Default: the default branch's HEAD commit ID is used
example
'mybranch'
buildStatusContextoptionalstringbuild_status_contextoptionalstrbuildStatusContextoptionalStringBuildStatusContextoptionalstringBuildStatusContextoptional*string#Default: "AWS CodeBuild
Can use built-in CodeBuild variables, like $AWS_REGION.
example
"My build #$CODEBUILD_BUILD_NUMBER"
buildStatusUrloptionalstringbuild_status_urloptionalstrbuildStatusUrloptionalStringBuildStatusUrloptionalstringBuildStatusUrloptional*string#Default: link to the AWS Console for CodeBuild to a particular build execution
Can use built-in CodeBuild variables, like $AWS_REGION.
example
"$CODEBUILD_PUBLIC_BUILD_URL"
cloneDepthoptionalnumberclone_depthoptionalint | floatcloneDepthoptionalNumberCloneDepthoptionaldoubleCloneDepthoptional*float64#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.
fetchSubmodulesoptionalbooleanfetch_submodulesoptionalboolfetchSubmodulesoptionalBooleanFetchSubmodulesoptionalboolFetchSubmodulesoptional*bool= false#httpsCloneUrlstringhttps_clone_urlstrhttpsCloneUrlStringHttpsCloneUrlstringHttpsCloneUrl*stringrequired#identifieroptionalstringidentifieroptionalstridentifieroptionalStringIdentifieroptionalstringIdentifieroptional*string#This property is required on secondary sources.
ignoreSslErrorsoptionalbooleanignore_ssl_errorsoptionalboolignoreSslErrorsoptionalBooleanIgnoreSslErrorsoptionalboolIgnoreSslErrorsoptional*bool= false#reportBuildStatusoptionalbooleanreport_build_statusoptionalboolreportBuildStatusoptionalBooleanReportBuildStatusoptionalboolReportBuildStatusoptional*bool= true#webhookoptionalbooleanwebhookoptionalboolwebhookoptionalBooleanWebhookoptionalboolWebhookoptional*bool#Default: true if any webhookFilters were provided, false otherwise
webhookFiltersoptionalFilterGroup[]webhook_filtersoptionaltyping.List[FilterGroup]webhookFiltersoptionalList<FilterGroup>WebhookFiltersoptionalFilterGroup[]WebhookFiltersoptional*[]FilterGroup#Default: every push and every Pull Request (create or update) triggers a build
A build is triggered if any of the provided filter groups match. Only valid if webhook was not provided as false.
webhookTriggersBatchBuildoptionalbooleanwebhook_triggers_batch_buildoptionalboolwebhookTriggersBatchBuildoptionalBooleanWebhookTriggersBatchBuildoptionalboolWebhookTriggersBatchBuildoptional*bool= false#Enabling this will enable batch builds on the CodeBuild project.