Skip to content

feat: add bake/specs.hcl with the shared tag, label and annotation rules - #82

Open
Ilyes512 wants to merge 1 commit into
mainfrom
4.0/specs-hcl
Open

Ilyes512 wants to merge 1 commit into
mainfrom
4.0/specs-hcl

Conversation

@Ilyes512

@Ilyes512 Ilyes512 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Adds bake/specs.hcl, the file bake.yml (#83) reads before a consumer's docker-bake.hcl, so consumers don't keep a copy of it, with specs_tags, specs_labels and specs_annotations (handoff Part 1, step 3, option C).

  • Tag push: semver set (1.2.3, 1.2 unless 0.0.x, 1 unless 0.x), plus latest (or the bare variant) only when IS_STABLE. A prerelease publishes only itself.
  • PR pr-N, branch name (sanitized), schedule nightly, dispatch tag, and :local for a local build.
  • Labels/annotations: version, revision, source, url, created, licenses, title, description, the same keys metadata-action gave 3.x images. An empty title or description falls back to the repository's (REPOSITORY_NAME / REPOSITORY_DESCRIPTION), as in 3.x. Empty values are left out.

bake/test/run.sh (task test) runs docker buildx bake --print for 12 cases (tag v1.2.3, -rc.1, v0.1.0, v0.0.5, non-semver, PR, branch, schedule, dispatch, local, unknown event) and diffs the result against the expected JSON. lint.yml runs it.

Part of the 4.0.0 stack (bake variant of the plan in #80). Merge bottom to top: #82 → #83 → #84 → #85 → #86 → #88.

The functions specs_tags, specs_labels and specs_annotations work out an
image's metadata from the variables bake.yml's plan job will set, so a
consumer's docker-bake.hcl describes what to build and this file decides
how it is tagged. Local builds get the defaults: a :local tag and
version dev.

bake/test/run.sh runs docker buildx bake --print on an example HCL file
for a set of events and compares the result with the expected JSON;
lint.yml runs it on every push.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant