So this is my .travis.yml
:
language: python
python:
- "3.5"
cache: pip
install:
- pip install awscli
script:
- echo 'test'
deploy:
provider: s3
access_key_id: $AWS_ACCESS_ID
secret_access_key: $AWS_SECRET_ID
bucket: "xxxxx.com"
local_dir: build
skip_cleanup: true
cache_control: "max-age=21600"
on:
branch: master
after_deploy:
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
It is just a html page without node or other framework. I want to push to AWS S3 bucket, and create an invalidation for this bucket's cloudfront.
The problem is, it can upload into AWS S3 bucket successfully, and can't run cloudfront to create invalidation.
I got this error message from Travis.
> Deploying application
> uploading "index.html" with {:content_type=>"text/html", :cache_control=>"max-age=21600"}
>$ aws configure set preview.cloudfront true
>$ aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
Unable to locate credentials. You can configure credentials by running "aws configure".
Done.
Any thoughts on that?