in cdk-project/lib/common.ts [132:181]
constructor(props: ProjectProps) {
this.repo = props.repo;
this.owner = props.owner === undefined ? "aws" : props.owner;
this.branch = props.branch === undefined ? "master" : props.branch;
this.enablePullRequestBuild =
props.enablePullRequestBuild === undefined ? true : props.enablePullRequestBuild;
this.enableReleaseBuild =
props.enableReleaseBuild === undefined ? true : props.enableReleaseBuild;
this.computeType = props.computeType || codebuild.ComputeType.SMALL;
this.customImage = props.customImage;
this.timeout = props.timeout === undefined ? Duration.hours(1) : props.timeout;
this.deploymentTimeout =
props.deploymentTimeout === undefined ? Duration.hours(8) : props.deploymentTimeout;
this.pullRequestBuildSpec =
props.pullRequestBuildSpec === undefined
? buildspecs.createPullRequestBuildSpec()
: props.pullRequestBuildSpec;
this.releaseBuildSpec =
props.releaseBuildSpec === undefined
? buildspecs.createPrimaryReleaseBuildSpec()
: props.releaseBuildSpec;
this.deployBuildSpec =
props.deployBuildSpec === undefined
? buildspecs.createDeployBuildSpec()
: props.deployBuildSpec;
this.addSourceToReleasePipeline =
props.addSourceToReleasePipeline === undefined
? false
: props.addSourceToReleasePipeline;
this.additionalBuildProjects =
props.additionalBuildProjects === undefined ? [] : props.additionalBuildProjects;
this.enableAutomaticRelease =
props.enableAutomaticRelease === undefined ? true : props.enableAutomaticRelease;
// default is 15h15 UTC, M-F (07h15 PDT, 08h15 PST)
this.releasePipelineScheduleExpression =
props.releasePipelineScheduleExpression === undefined
? "cron(15 15 ? * MON-FRI *)"
: props.releasePipelineScheduleExpression;
if (props.name === undefined) {
// default is <owner>-<repo>-<branch>
// but 'aws' and 'master' are omitted for brevity
this.name = `${this.owner}-${this.repo}-${this.branch}`
.replace(/^aws-/, "")
.replace(/-master$/, "");
} else {
this.name = props.name;
}
}