originix/cloudflare-purge-cache
the bitbucket pipeline for purge cache cloudflare
111
This Bitbucket Pipelines pipe allows you to request a cache purge of your Cloudflare.
Add the following snippet to the script section of your bitbucket-pipelines.yml
file:
- pipe: docker://originix/cloudflare-purge-cache:0.1.0
variables:
CF_API_KEY: '<string>' # required
CF_ZONE_ID: '<string>' # required
PURGE_EVERYTHING: '<bool>' # optional
FILES: '<string>' # optional
TAGS: '<string>' # optional
HOSTS: '<string>' # optional
PREFIXES: '<string>' # optional
DEBUG: '<string>' # optional
Variable | Usage |
---|---|
CF_API_KEY (*) | Cloudflare API key |
CF_ZONE_ID (*) | Cloudflare Zone ID |
PURGE_EVERYTHING | purge everything |
FILES | List of white space separated file to purge cache. |
TAGS | List of white space separated tag to purge cache. |
HOSTS | List of white space separated host to purge cache. |
PREFIXES | List of white space separated prefix to purge cache. |
DEBUG | Turn on extra debug information. Default: false . |
(*) = required variable. This variable needs to be specified always when using the pipe.
Purge cache for everything:
script:
- pipe: docker://originix/cloudflare-purge-cache:0.1.0
variables:
CF_API_KEY: $CF_API_KEY
CF_ZONE_ID: $CF_ZONE_ID
PURGE_EVERYTHING: 'true'
Purge cache for a list of files:
script:
- pipe: docker://originix/cloudflare-purge-cache:0.1.0
variables:
CF_API_KEY: $CF_API_KEY
CF_ZONE_ID: $CF_ZONE_ID
FILES: 'www.example.com/img/cat.png www.example.com/img/dog.png'
Purge cache for a list of tags:
script:
- pipe: docker://originix/cloudflare-purge-cache:0.1.0
variables:
CF_API_KEY: $CF_API_KEY
CF_ZONE_ID: $CF_ZONE_ID
TAGS: 'tag-foo tag-bar'
Purge cache for a list of hosts:
script:
- pipe: docker://originix/cloudflare-purge-cache:0.1.0
variables:
CF_API_KEY: $CF_API_KEY
CF_ZONE_ID: $CF_ZONE_ID
HOSTS: 'example.com api.example.com'
Purge cache for a list of prefix:
script:
- pipe: docker://originix/cloudflare-purge-cache:0.1.0
variables:
CF_API_KEY: $CF_API_KEY
CF_ZONE_ID: $CF_ZONE_ID
PREFIXES: 'example.com/media/* api.example.com/users/*'
docker run \
-e CF_API_KEY="$CF_API_KEY" \
-e CF_ZONE_ID="$CF_ZONE_ID" \
-e PURGE_EVERYTHING="true" \
originix/cloudflare-purge-cache:0.1.0
If you’d like help with this pipe, or you have an issue or feature request.
If you’re reporting an issue, please include:
Copyright (c) 2024 originix. MIT License, see LICENSE file.
docker pull originix/cloudflare-purge-cache