You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The tool can generate both static CircleCI configs and setup/dynamic configs. Th
15
15
- Architecture variants per job (e.g., `build_amd64`, `build_arm64`)
16
16
- Advanced git checkout: shallow clone by default with configurable clone/fetch options, host key scanning, and path overrides
17
17
- Descriptive error messages and schema/data validation ([miette], JSON Schema)
18
+
- Opt-in Docker builds with a single BASE_HASH and image DAG
18
19
19
20
## Not Yet Implemented / In Progress
20
21
@@ -249,3 +250,54 @@ This project is licensed under the MIT License - see the LICENSE file for detail
249
250
## Support
250
251
251
252
For issues and feature requests, please use the [GitHub issue tracker](https://github.com/DocSpring/cigen/issues).
253
+
254
+
### Docker Builds (opt-in)
255
+
256
+
CIGen can build and tag your CI Docker images as first-class jobs. Enable it with split config under `.cigen/config/docker_build.yml` or inline in your config:
257
+
258
+
```yaml
259
+
docker_build:
260
+
enabled: true
261
+
# Optional on CircleCI cloud
262
+
layer_caching: true
263
+
264
+
registry:
265
+
repo: yourorg/ci
266
+
# Default push behavior (true recommended on cloud)
267
+
push: true
268
+
269
+
images:
270
+
- name: ci_base
271
+
dockerfile: docker/ci/base.Dockerfile
272
+
context: .
273
+
arch: [amd64]
274
+
build_args:
275
+
BASE_IMAGE: cimg/base:current
276
+
# Sources for the canonical BASE_HASH (one hash across images)
277
+
hash_sources:
278
+
- scripts/package_versions_env.sh
279
+
- .tool-versions
280
+
- .ruby-version
281
+
- docker/**/*.erb
282
+
- scripts/docker/**
283
+
depends_on: []
284
+
# Optional per-image push override
285
+
# push: false
286
+
```
287
+
288
+
What happens:
289
+
290
+
- CIGen computes one `BASE_HASH` by hashing all declared `hash_sources` (path + content) across images.
291
+
- For each image+arch, a `build_<image>` job builds `registry/<name>:<BASE_HASH>-<arch>` and (optionally) pushes it.
292
+
- Downstream jobs that specify `image: <name>` are resolved to `registry/<name>:<BASE_HASH>-<arch>` and automatically `require``build_<image>`.
293
+
- Build jobs include job-status skip logic (native CircleCI cache or Redis) so unchanged images skip quickly.
294
+
- On CircleCI cloud, `layer_caching: true` emits `setup_remote_docker: { docker_layer_caching: true }` for faster rebuilds.
295
+
296
+
Notes:
297
+
298
+
- If a job `image` contains `/` or `:`, it is treated as a full reference and not rewritten.
299
+
- Per-image `push` overrides the registry default.
0 commit comments