Skip to content

Extracted platform config to platforms.json and automated image updates#2161

Merged
olehermanse merged 6 commits intocfengine:masterfrom
larsewi:baseimages
Apr 8, 2026
Merged

Extracted platform config to platforms.json and automated image updates#2161
olehermanse merged 6 commits intocfengine:masterfrom
larsewi:baseimages

Conversation

@larsewi
Copy link
Copy Markdown
Contributor

@larsewi larsewi commented Apr 8, 2026

Summary

  • Moved platform configuration (image names, versions, base images, Dockerfiles) from Python code to platforms.json
  • Pinned base images to SHA256 digests for reproducible builds
  • Changed --push-image to use UTC timestamp versions instead of manual bumps
  • Added --update flag to fetch latest image versions from the ghcr.io registry
  • Added weekly cron schedule to build base images (Sunday) and a new workflow to update platforms.json and create a PR (Monday)

🤖 Generated with Claude Code

larsewi added 6 commits April 8, 2026 19:12
Extracted PLATFORMS and IMAGE_VERSION from build-in-container.py into a
flat platforms.json file, loaded via a cached get_config() function.
Each platform now has separate image_name and image_version fields
(split from image_tag), and extra_build_args can be omitted when empty.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Pinned each base image to a specific digest for reproducible builds.
The digest is appended to the base_image reference when passed to
docker build.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Replaced the manual version bump check with automatic timestamp-based
versioning (e.g., 20260408T153042Z) when pushing images. Removed the
now-unused image_exists_in_registry function.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The workflow now runs every Sunday at midnight UTC to keep base images
up to date with the latest upstream packages.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Queries the ghcr.io registry API for the latest tags and updates
image_version in platforms.json. Supports --platform to update a
single platform, or updates all when omitted.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Runs every Monday at midnight and creates a PR if platforms.json was
updated with newer image tags.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
log.error("Docker push failed.")
sys.exit(1)

log.info(f"Update image_version to \"{version}\" in platforms.json.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info(f"Update image_version to \"{version}\" in platforms.json.")
log.info(f"Updated image_version to \"{version}\" in platforms.json.")

@olehermanse olehermanse merged commit 7b600fa into cfengine:master Apr 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants