Source Class
Source provider definition for a CodeBuild Project.
Example
ts
declare const myCachingBucket: s3.Bucket;
new codebuild.Project(this, 'Project', {
source: codebuild.Source.bitBucket({
owner: 'awslabs',
repo: 'aws-cdk',
}),
cache: codebuild.Cache.bucket(myCachingBucket),
// BuildSpec with a 'cache' section necessary for S3 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
Methods
bind(_scope: Construct, _project: IProject): SourceConfigdef bind(self, _scope: Construct, _project: IProject) -> SourceConfigpublic SourceConfig bind(Construct _scope, IProject _project)public SourceConfig Bind(Construct _scope, IProject _project)func Bind(_scope Construct, _project IProject) SourceConfig#Called by the project when the source is added so that the source can perform binding operations on the source.
For example, it can grant permissions to the code build project to read from the S3 bucket.
bitBucket(props: BitBucketSourceProps): ISource@staticmethod def bit_bucket(props: BitBucketSourceProps) -> ISourcepublic static ISource bitBucket(BitBucketSourceProps props)public static ISource BitBucket(BitBucketSourceProps props)func BitBucket(Props BitBucketSourceProps) ISourcestatic#codeCommit(props: CodeCommitSourceProps): ISource@staticmethod def code_commit(props: CodeCommitSourceProps) -> ISourcepublic static ISource codeCommit(CodeCommitSourceProps props)public static ISource CodeCommit(CodeCommitSourceProps props)func CodeCommit(Props CodeCommitSourceProps) ISourcestatic#gitHub(props: GitHubSourceProps): ISource@staticmethod def git_hub(props: GitHubSourceProps) -> ISourcepublic static ISource gitHub(GitHubSourceProps props)public static ISource GitHub(GitHubSourceProps props)func GitHub(Props GitHubSourceProps) ISourcestatic#gitHubEnterprise(props: GitHubEnterpriseSourceProps): ISource@staticmethod def git_hub_enterprise(props: GitHubEnterpriseSourceProps) -> ISourcepublic static ISource gitHubEnterprise(GitHubEnterpriseSourceProps props)public static ISource GitHubEnterprise(GitHubEnterpriseSourceProps props)func GitHubEnterprise(Props GitHubEnterpriseSourceProps) ISourcestatic#s3(props: S3SourceProps): ISource@staticmethod def s3(props: S3SourceProps) -> ISourcepublic static ISource s3(S3SourceProps props)public static ISource S3(S3SourceProps props)func S3(Props S3SourceProps) ISourcestatic#