ENT-13777: Added container-based CFEngine package builder#2146
ENT-13777: Added container-based CFEngine package builder#2146larsewi wants to merge 1 commit intocfengine:masterfrom
Conversation
|
Thanks for submitting a pull request! Maybe @craigcomstock can review this? |
olehermanse
left a comment
There was a problem hiding this comment.
Looks good overall, some comments and suggestions here and there.
| @@ -0,0 +1,362 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
IIRC craig said we already have a script for this, which is used in GH Actions. Might be good to align this, maybe delete the old one and start using the new one if appropriate.
There was a problem hiding this comment.
Yepp, he probably means enterprise/ci/docker-build-package.sh. Although this script also runs tests, which we are trying to separate.
We can replace it after adding SFTP cache support to build-in-container.py.
| # === Build steps === | ||
| run_step "01-autogen" "$BASEDIR/buildscripts/build-scripts/autogen" | ||
| run_step "02-install-dependencies" "$BASEDIR/buildscripts/build-scripts/install-dependencies" | ||
| if [ "$EXPLICIT_ROLE" = "hub" ]; then | ||
| run_step "03-mission-portal-deps" install_mission_portal_deps | ||
| fi | ||
| run_step "04-configure" "$BASEDIR/buildscripts/build-scripts/configure" | ||
| run_step "05-compile" "$BASEDIR/buildscripts/build-scripts/compile" | ||
| run_step "06-package" "$BASEDIR/buildscripts/build-scripts/package" |
There was a problem hiding this comment.
Looks like we should rename build-scripts folder to steps / build-steps 😅.
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Build tools extracted from ci/cfengine-build-host-setup.cf (debian|ubuntu section) |
There was a problem hiding this comment.
yeah, it would be sad to copy/paste that content here so that now we have to maintain two locations again.
|
|
||
| # Hub build tools: Node.js 20 LTS (system nodejs is too old for modern npm | ||
| # packages that use the node: protocol), PHP, and Composer | ||
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ |
There was a problem hiding this comment.
would be nice to stick with individual scripts we can maintain with new versions like https://github.com/cfengine/buildscripts/blob/master/ci/linux-install-jdk21.sh
|
|
||
| PLATFORMS = { | ||
| "ubuntu-20": { | ||
| "base_image": "ubuntu:20.04", |
There was a problem hiding this comment.
Ideally we would have a two-tiered approach here so we can automate and cache:
- the base image + updates, cache that
- the patched base image + build dependencies, cache that
Introduced build-in-container, a Python/Docker-based build system that builds CFEngine packages inside containers using the existing build scripts. Ticket: ENT-13777 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
build-in-container, a Python/Docker-based build tool that builds CFEngine packages inside containers using the existing build scriptsSee
build-in-container.mdfor full documentation.