Skip to content

Replace CI bash loop with Makefile#12

Merged
loks0n merged 2 commits into
mainfrom
makefile-build
May 14, 2026
Merged

Replace CI bash loop with Makefile#12
loks0n merged 2 commits into
mainfrom
makefile-build

Conversation

@loks0n
Copy link
Copy Markdown
Contributor

@loks0n loks0n commented May 14, 2026

Summary

  • The bash arg-extraction loop introduced in Templated Dockerfile + slim runtime image #11 for sourcing versions/<X.Y>.env and turning each key into a --build-arg flag was hard to read and not reusable locally.
  • Replace with a small Makefile exposing make build, make test, and make all.
  • ci.yml now calls make build VERSION=… IMAGE=utopia-base-test instead of inlining shell.
  • README updated to document the make targets.

Stacked on top of #11 — please review/merge that one first.

Test plan

  • CI builds all three versions × both arches green via make build
  • make test VERSION=8.4 passes locally with container-structure-test installed

🤖 Generated with Claude Code

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 14, 2026

Greptile Summary

Replaces the verbose bash arg-extraction loop in ci.yml with a small Makefile that exposes build, test, all, and clean targets, and updates the README accordingly.

  • The awk-based BUILD_ARGS expansion and set -a env sourcing in the build target faithfully replicate the original shell logic; the CI change is a one-liner that delegates to make build.
  • The VERSIONS list is auto-discovered via $(wildcard versions/*.env), avoiding the static hardcoding concern raised in prior review threads.

Confidence Score: 5/5

Safe to merge — the change is a straightforward refactor of CI shell logic into a Makefile with no behavioral changes to the build or test pipeline.

The Makefile faithfully replicates the original bash loop (env sourcing + awk arg extraction), the CI workflow change is minimal, and all downstream jobs remain unmodified.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Build step simplified from a 10-line bash loop to a single make build call; downstream jobs (structure-test, dive, trivy) are unchanged and still reference utopia-base-test consistently.
Makefile New Makefile exposes build/test/all/clean targets; awk-based BUILD_ARGS extraction and env sourcing faithfully replicate the original bash loop; version list is auto-discovered via wildcard so all avoids the hardcoded duplication concern.
README.md Local-development section replaced with the three make targets; the note about adding new versions still correctly points to both ci.yml and publish.yml.

Reviews (3): Last reviewed commit: "Address PR feedback: derive versions lis..." | Re-trigger Greptile

Comment thread Makefile Outdated
Comment thread Makefile Outdated
The bash arg-extraction loop in ci.yml and the README was hard to read
and not reusable locally. A Makefile replaces it with one-line commands:

  make build VERSION=8.4
  make test VERSION=8.4
  make all

CI now invokes `make build` directly. README documents the same commands.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@loks0n loks0n changed the base branch from simplify-versions to main May 14, 2026 22:24
…oped tags

- VERSIONS now expands from versions/*.env via wildcard, so adding a new
  PHP version no longer requires updating the Makefile alongside ci.yml
  matrix.
- Default IMAGE is now utopia-base-test:$(VERSION) so 'make all' produces
  three distinct tags instead of overwriting :latest each iteration.
- 'make clean' iterates VERSIONS for the same reason.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@loks0n loks0n merged commit e88c5c0 into main May 14, 2026
20 checks passed
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