Reputation: 2624
So I need to exclude a folder from my artifacts, but googling around could not find any info.
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
build:
commands:
- echo Build started on `date`
- echo Compiling the Node.js code
- mocha test.js
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- '**/*'
Upvotes: 2
Views: 6051
Reputation: 81
buildspec.yml currently support excluding paths in the artifacts section.
artifacts:
exclude-paths:
- ./**/someFilePatternHere
- ./**/otherFilePatternHere
It follows the same logic as the files: section but does exclude particular files. See: https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.artifacts.exclude-paths
ps: exclude-paths is relative to base-directory property.
Upvotes: 8
Reputation: 238209
buildspec.yaml does not provide a way to skip some files or folders when constructing artifacts.
Thus, based on the comments, the easiest solution to the problem was to simply delete unneeded files and folders in the post_build
stage.
Upvotes: 4
Reputation: 17
1 Solution = exclude in .gitingnore file. 2 Solution = add this in below your code. Let me know if it works
artifacts: files: - '**/' excluded_paths: - foldername/
Upvotes: -1