Build Process
From BCCD 3.0
(→Build stages) |
(→debootstrap) |
||
Line 56: | Line 56: | ||
; Triggers : [[Build_Process#debootstrap-bccd|<code>debootstrap-bccd</code>]] | ; Triggers : [[Build_Process#debootstrap-bccd|<code>debootstrap-bccd</code>]] | ||
- | Produces the artifact by running the <code>bin/prepare_debootstrap</code> script. | + | Produces the artifact by running the <code>bin/prepare_debootstrap</code> script and the <code>DEBIAN_RELEASE</code> variable in <code>bccd.conf</code>. |
=== <code>fpm</code> === | === <code>fpm</code> === |
Latest revision as of 00:03, 30 November 2020
Contents |
Introduction
This document describes the build process for BCCD. The legacy process describes the old build_livecd.pl
script; the improved process will describe the replacement for it.
Legacy process
The legacy process is driven by the bin/build_livecd.pl
script in SVN. This script turns 8 years old on April 14, 2015 and, while functional, represents a much more rudimentary time for BCCD, both in terms of the distribution support and the team's (mainly Skylar's) software development knowledge.
The purpose of this section will be to document this legacy process comprehensively, and take inventory of its deficiencies so as to create the improved process.
Relationship with Bccd.pm
build_livecd.pl
makes heavy use of Bccd.pm
. Bccd.pm
itself has a number of deficiencies itself:
- Poor error-handling - it will either log or die, when current best-practice for Perl is to throw an exception by returning
undef
, and catch ineval
- Excessively large methods
- Poor logging - logging should be built-in rather than requiring use of
if
/else
- Global filehandles - these should be scoped scalars
- Too many methods - should be broken up into multiple classes w/ inheritance
Legacy process details
The legacy process has the following stages:
- Configuration:
- Parse the YAML configuration file in the workspace into a hash reference
- Override configuration keys via command line option
- Debmirror - set the local debian mirror host so that we don't overload Earlham's Internet connection
- Hard coded settings - a large block of hard-coded settings
Legacy process deficiencies
- Tests are integrated with the build, making test-driven development difficult/impossible
- Error reporting is inconsistent
- Object orientation implementation gets in the way, some things might be better implemented as a simple library, with OO where appropriate
- Object orientation might be useful for some things, e.g. handling networking configuration for multiple NICs
- Some architecture-specific actions are hard-coded into the build
- Would be nice to support other architectures like ARM
Improved process
See also: the talk page
Build stages
The improved process is a Make-/Jenkins-driven pipeline. The Makefile
lives in the root of the SVN branch/tag. The Jenkins pipeline consists of the following stages:
debootstrap
- Artifact
-
target/debootstrap.tar.bz2
- Make target
-
target/debootstrap.tar.bz2
- Triggers
-
debootstrap-bccd
Produces the artifact by running the bin/prepare_debootstrap
script and the DEBIAN_RELEASE
variable in bccd.conf
.
fpm
- Artifact
-
target/bccd.noarch.deb
,build/etc/bccd-revision
- Make target
-
target/bccd.noarch.deb
- Triggers
-
debootstrap-bccd
Generates bccd.noarch.deb
using rpm
and the checked-out files in the src
directory.
debootstrap-bccd
- Dependencies
-
target/debootstrap.tar.bz2
,build/etc/bccd-revision
- Artifact
-
target/debootstrap-bccd.tar.bz2
- Make target
-
target/debootstrap-bccd.tar.bz2
- Triggers
-
iso
Unpacks target/debootstrap.tar.bz2
, runs bin/bccd_install_pkgs
within it, and then creates target/debootstrap-bccd.tar.bz2
NOTE: Both the debootstrap
and fpm
will trigger this target. debootstrap
only has to be run when updating the OS, while fpm
needs to be run when the BCCD package is updated.
iso
- Dependencies
-
target/bccd.noarch.deb
,build/etc/bccd-revision
,target/debootstrap-bccd.tar.bz2
- Make target
-
target/bccd.amd64.iso
Unpacks debootstra-bccd.tar.bz2
, installs target/bccd.noarch.deb
within, then produces a filesystem.squashfs
artifact, and finally an ISO image containing the squashfs
.