{"id":21482618,"url":"https://github.com/jetrails/drone-cloudflare-caching","last_synced_at":"2025-07-15T13:32:49.369Z","repository":{"id":91417441,"uuid":"198898661","full_name":"jetrails/drone-cloudflare-caching","owner":"jetrails","description":"Drone plugin to purge cache via Cloudflare's API","archived":false,"fork":false,"pushed_at":"2023-03-06T21:43:38.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T20:04:15.979Z","etag":null,"topics":["cloudflare-api","cloudflare-caching","drone","drone-plugin"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/jetrails/drone-cloudflare-caching","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jetrails.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-25T20:42:11.000Z","updated_at":"2023-03-06T21:41:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"da694688-146f-4f83-afdf-7c35fa39c5b5","html_url":"https://github.com/jetrails/drone-cloudflare-caching","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetrails%2Fdrone-cloudflare-caching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetrails%2Fdrone-cloudflare-caching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetrails%2Fdrone-cloudflare-caching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetrails%2Fdrone-cloudflare-caching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jetrails","download_url":"https://codeload.github.com/jetrails/drone-cloudflare-caching/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226045047,"owners_count":17564916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare-api","cloudflare-caching","drone","drone-plugin"],"created_at":"2024-11-23T12:34:49.873Z","updated_at":"2024-11-23T12:34:50.396Z","avatar_url":"https://github.com/jetrails.png","language":"Go","readme":"# Drone — Cloudflare Caching\n\u003e Drone plugin to purge cache via Cloudflare's API\n\n![](https://img.shields.io/badge/License-MIT-lightgray.svg?style=for-the-badge)\n![](https://img.shields.io/docker/stars/jetrails/drone-cloudflare-caching.svg?style=for-the-badge\u0026colorB=9f9f9f)\n![](https://img.shields.io/docker/pulls/jetrails/drone-cloudflare-caching.svg?style=for-the-badge\u0026colorB=9f9f9f)\n\n## About\n\nOur Drone plugin enables the ability for your pipeline to interface with Cloudflare's API to purge cache. This plugin is written in Go and it uses the [cloudflare-go](https://github.com/cloudflare/cloudflare-go) package to communicate with Cloudflare's API. For information on Cloudflare's API please refer to their [documentation](https://api.cloudflare.com/#zone-purge-all-files) page.\n\n## Cloudflare Token\n\nThe API token that is used to authenticate with Cloudflare's API can be created in Cloudflare's dashboard. It is recommended to create an API token that includes only the zone resource you want to manipulate and give edit permissions only to the Cache Purge resource.\n\n## Build\n\nDevelop locally by running the plugin with the following commands. Also please note that you should specify environmental variables for the plugin either via the inline method (`FOO=bar go run src/main`) or via the `export FOO=bar` method before the `go run` command.\n\n```shell\n$ go mod download\n$ go run src/main.go\n```\n\n## Docker\n\nDrone plugins work off of docker images. The following commands will go over building, pushing, and running the docker image for this plugin.\n\n###### Build Docker Image:\n\n```shell\n$ docker build -t jetrails/drone-cloudflare-caching .\n```\n\n###### Run Docker Container:\n\nYou can then replicate the command that Drone will use to launch the plugin by running:\n\n```shell\n$ docker run --rm \\\n\t-e PLUGIN_API_TOKEN=\"u4C7ev06GMS8_vWBTpjqtVReT3I7FwGpW7MG44ZD\" \\\n\t-e PLUGIN_ZONE_IDENTIFIER=\"eJzrjE44s6Ki67x1tSDJzI8LdXxM3nj7\" \\\n\t-e PLUGIN_ACTION=\"purge_everything\" \\\n\t-v $(pwd):/drone/src \\\n\t-w /drone/src \\\n\tjetrails/drone-cloudflare-caching\n```\n\n###### Push Docker Image:\n\nFinally, push this image to our Docker Hub [repository](https://hub.docker.com/r/jetrails/drone-cloudflare-caching) (assuming you have permission):\n\n```shell\n$ docker push jetrails/drone-cloudflare-caching\n```\n\n## Usage\n\nThis plugin supports purging all cache, purging hosts, purging files, and purging tags. Please refer to the table below with all possible settings that can be passed to the plugin:\n\n|       Name      |           Required         | Default | Case-Sensitive |                            Type                           |\n|:---------------:|:--------------------------:|:-------:|:--------------:|:---------------------------------------------------------:|\n|    api_token    |             Yes            |    -    |       Yes      |                           STRING                          |\n| zone_identifier |             Yes            |    -    |       Yes      |                           STRING                          |\n|      action     |             Yes            |    -    |       No       | ENUM[purge_everything,purge_hosts,purge_files,purge_tags] |\n|       list      | action != purge_everything |    -    |       Yes      |                       ARRAY\\\u003cSTRING\\\u003e                       |\n\n## Examples\n\n```yaml\nkind: pipeline\nname: default\n\nsteps:\n-   name: cloudflare\n    image: jetrails/drone-cloudflare-caching\n    settings:\n        api_token:\n            from_secret: cloudflare_token\n        zone_identifier:\n            from_secret: cloudflare_zone_identifier\n        action: purge_everything\n```\n\n```yaml\nkind: pipeline\nname: default\n\nsteps:\n-   name: cloudflare\n    image: jetrails/drone-cloudflare-caching\n    settings:\n        api_token:\n            from_secret: cloudflare_token\n        zone_identifier:\n            from_secret: cloudflare_zone_identifier\n        action: purge_hosts\n        list:\n        -   example.com\n        -   foo.example.com\n        -   bar.example.com\n```\n\n```yaml\nkind: pipeline\nname: default\n\nsteps:\n-   name: cloudflare\n    image: jetrails/drone-cloudflare-caching\n    settings:\n        api_token:\n            from_secret: cloudflare_token\n        zone_identifier:\n            from_secret: cloudflare_zone_identifier\n        action: purge_files\n        list:\n        -   https://example.com/script.js\n        -   https://example.com/logo.svg\n```\n\n```yaml\nkind: pipeline\nname: default\n\nsteps:\n-   name: cloudflare\n    image: jetrails/drone-cloudflare-caching\n    settings:\n        api_token:\n            from_secret: cloudflare_token\n        zone_identifier:\n            from_secret: cloudflare_zone_identifier\n        action: purge_tags\n        list:\n        -   foo\n        -   bar\n```\n\n## Feature Requests / Issues\n\nFeel free to open an issue for any feature requests and issues that you may come across. For furthur inquery, please contact [development@jetrails.com](mailto://development@jetrails.com).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetrails%2Fdrone-cloudflare-caching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetrails%2Fdrone-cloudflare-caching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetrails%2Fdrone-cloudflare-caching/lists"}