This pipe will create an invalidation on a Cloudfront distribution
1.7K
This pipe will create an invalidation on a Cloudfront distribution
Add the following snippet to the script section of your bitbucket-pipelines.yml file:
script:
- pipe: nhammond101/cloudflare-cache-clear:0.1.0
variables:
AWS_ACCESS_KEY_ID: "<string>"
AWS_SECRET_ACCESS_KEY: "<string>"
DOMAIN: "<string>"
# DEBUG: "<boolean>" # Optional
| Variable | Usage |
|---|---|
| AWS_ACCESS_KEY_ID (*) | Your AWS Access Key. |
| AWS_SECRET_ACCESS_KEY (*) | Your AWS Secret. |
| DEBUG | Turn on extra debug information. Default: false. |
| DOMAIN (*) | The domain name to create the invalidation for |
(*) = required variable.
Basic example:
script:
- pipe: nhammond101/cloudflare-cache-clear:0.1.0
variables:
AWS_ACCESS_KEY_ID: "AB****************CD"
AWS_SECRET_ACCESS_KEY: "EF************************************GH"
DOMAIN: "cloudfront-invalidate.waracle.net"
# DEBUG: "<boolean>" # Optional
Advanced example:
script:
- pipe: nhammond101/cloudflare-cache-clear:0.1.0
variables:
AWS_ACCESS_KEY_ID: "AB****************CD"
AWS_SECRET_ACCESS_KEY: "EF************************************GH"
DOMAIN: "cloudfront-invalidate.waracle.net"
DEBUG: "true"
To test locally, you will need to install bats and an environment file (.env) with your AWS credentials
.env in the root of the project, and confirm it is referenced in the .gitignore file, as these values should NOT be in the reponpm i -g batsNow you can run /usr/local/bin/bats ./test/test.bats
which will run the unit tests, which build the docker image, passes in the environment variables and invalidates the Cloudfront distribution specified in the DOMAIN variable
If you'd like help with this pipe, or you have an issue or feature request, let us know on Community.
If you're reporting an issue, please include:
Content type
Image
Digest
Size
31.6 MB
Last updated
about 7 years ago
docker pull nhammond101/cloudfront-cache-clear