- Newest
- Most votes
- Most comments
You need to use BuildSpec.fromSourceFileName to specify the path of the file in the source repository. The other methods, namely fromObject and fromAsset, are intended for CDK projects where the buildspec is stored locally to the project. To keep it simple, review the following:
fromAsset - loads from a local file path of the CDK project
fromObject - loads from an object variable in memory
fromSourceFileName - specifies the filename and path in the source code repo for the yml file of your buildspec.
Hope this helps, please accept this answer if it does.
The difference between fromAsset and fromSourceFileName is that fromAsset uses files locally while fromSourceFileName uses from the source code server (which is not the local git repository).
Let's assume you had a config folder off the root of your project. You could use the FromAsset method to load from this config folder.
If you have want to reference the buildspec from source code repository (on either Github, CodeCommit, or BitBucket) you would utilize the fromSourceFileName method. This source code repository is not your local development environment.
Hope this helps
Relevant content
- asked 2 years ago
- Accepted Answerasked 3 years ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
Hey Bryant, this was helpful. But I am a bit confused between fromSourceFileName and fromAsset explanation given above. Both seem the same to me. Please can you clarify it a bit?