Skip to content

Tags: buildkite-plugins/docker-cache-buildkite-plugin

Tags

Verified

This tag was signed with the committer’s verified signature.
petetomasik Pete Tomasik

Verified

This tag was signed with the committer’s verified signature.
petetomasik Pete Tomasik

v1.0.0

Toggle v1.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add plugin base (#1)

* [WIP] Adding baseline of plugin

Currently, this plugin is a rough draft of the end product I am aiming for, with additional functions to be added.

For the time being, it adds support for acr/dockerhub/ecr/gcr but has not been tested. This will need to be tested on each provider.

On next commits I will add Buildkite as a provider, as well as potentially package cloud, as it's more or less a copy and paste job with the way I've designed this to be reusable for the most-part and providing our solutions here is logical for an in-house plugin.

I will move on to testing functionality to ensure the base foundations are working as expected and make changes from there to get it more in line with my vision.

[WIP]

* Fix unbound vars

Fix plugin prefix

Fix PLUGIN_PREFIX maybe

wat

* Fix Google Artifact Registry

Fixes
```
name invalid: Missing image name. Pushes should be of the form docker push HOST-NAME/PROJECT-ID/REPOSITORY/IMAGE
[ERROR]: Failed to push cache image
[ERROR]: Failed to save cache to GCR
```

Also, rename gcr to gar as GCR is gone:
https://cloud.google.com/artifact-registry/docs/transition/transition-from-gcr

* Removing acr/dockerhub

* Adding debug verbosity

* Removing cruft

refactor: remove multi-registry support in favor of single-registry calls

I had initially intended for the plugin to allow multiple calls to different registries, but decided it was too convoluted and would be best for multiple calls to the plugin within a pipeline for this functionality

* Cleaning up duplications

* Feat: consolidate hooks and enhance caching functionality

- Remove redundant command and post-command hooks
- Consolidate caching logic into pre-command hook with Docker build support
- Add support for multiple caching strategies (artifact, build-time, hybrid)
- Implement complete provider architecture for ECR and GAR registries
- Add configuration validation and dependency checking
- Expand plugin.yml with full feature set including build args, secrets, and strategies
- Remove unused PLUGIN_PREFIX variable and standardize environment variable usage
- Add automatic cache key generation from dependency files
- Implemented cache hit/miss logic with fallback strategies

* -n is missing on MacOS?

* Expansion issue with -u set

* Adding var to placeholder

* Adding fixes for finding cache

- Will look for :latest tag when it cannot find cache key (in the case that it was auto generated)
- Fixed gar.io, I think this was assumed as it's a GoDaddy parked domain and Google look to have moved to pkg.dev

* Rework hash on Dockerfile

* Update pre-command

* Adding redundancy checks

* Rename "build-time" as it sounds clunky

* Adding bat tests (working)

- Added some comments here as had to create functions to work around some stub issues.

* README, linting

* Lint and spellcheck fixes

---------

Co-authored-by: Joe Coleman <joe@buildkite.com>