Skip to content

Commit 252d99c

Browse files
scaduJoeColeman95
andauthored
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>
1 parent 95a184a commit 252d99c

File tree

13 files changed

+2055
-151
lines changed

13 files changed

+2055
-151
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ steps:
88
- label: ":sparkles: Lint"
99
plugins:
1010
- plugin-linter#v3.3.0:
11-
id: template
11+
id: docker-cache
1212

1313
- label: ":shell: Shellcheck"
1414
plugins:
1515
- shellcheck#v1.4.0:
1616
files:
1717
- hooks/**
18-
- lib/**
18+
- lib/*.bash
19+
- lib/providers/*.bash

0 commit comments

Comments
 (0)