Skip to content

Commit

Permalink
Update old files so they can be zipped
Browse files Browse the repository at this point in the history
CodeBuild was giving me an error like:

> [Container] 2020/09/21 18:50:44 Entering phase BUILD
> [Container] 2020/09/21 18:50:44 Running command aws cloudformation
> package --template template.yml --s3-bucket $S3_BUCKET --output-template \
> template-export.yml
> Unable to upload artifact None referenced by CodeUri parameter of
> HelloWorld resource.
> ZIP does not support timestamps before 1980

This implements [a
workaround](aws/aws-cli#2639 (comment)),
slightly adapted. The command

find node_modules/ -mtime +14600 -print

revealed that some files within node_modules/@babel and
node_modules/babel-preset-current-node-syntax were very old.
  • Loading branch information
douglasnaphas committed Sep 21, 2020
1 parent ba66b62 commit 8b6bb6d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ phases:
- npm test
build:
commands:
# Update the age of old files
# Some packages can bring in old files, causing the error:
# ZIP does not support timestamps before 1980
- find node_modules/ -mtime +14600 -exec touch {} +
# Use AWS SAM to package the application using AWS CloudFormation
- aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml

Expand Down

0 comments on commit 8b6bb6d

Please sign in to comment.