Build Process
From BCCD 3.0
(→Improved process) |
(→Build stages) |
||
Line 57: | Line 57: | ||
Produces the artifact by running the <code>bin/prepare_debootstrap</code> script. | Produces the artifact by running the <code>bin/prepare_debootstrap</code> script. | ||
+ | |||
+ | === <code>fpm</code> === | ||
+ | |||
+ | ; Artifact : <code>target/bccd.noarch.deb</code>, <code>build/etc/bccd-revision</code> | ||
+ | ; Make target : <code>target/bccd.noarch.deb</code> | ||
+ | ; Triggers : [[Build_Process#debootstrap-bccd|<code>debootstrap-bccd</code>]] | ||
+ | |||
+ | Generates <code>bccd.noarch.deb</code> using <code>rpm</code> and the checked-out files in the <code>src</code> directory. | ||
=== <code>debootstrap-bccd</code> === | === <code>debootstrap-bccd</code> === | ||
Line 67: | Line 75: | ||
Unpacks <code>target/debootstrap.tar.bz2</code>, runs <code>bin/bccd_install_pkgs</code> within it, and then creates <code>target/debootstrap-bccd.tar.bz2</code> | Unpacks <code>target/debootstrap.tar.bz2</code>, runs <code>bin/bccd_install_pkgs</code> within it, and then creates <code>target/debootstrap-bccd.tar.bz2</code> | ||
- | + | '''NOTE''': Both the [[Build_Process#debootstrap|<code>debootstrap</code>]] and [[Build_Process#fpm|<code>fpm</code>]] will trigger this target. <code>debootstrap</code> only has to be run when updating the OS, while <code>fpm</code> needs to be run when the BCCD package is updated. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
=== <code>iso</code> === | === <code>iso</code> === |
Revision as of 21:56, 19 March 2017
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 consisting 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.
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
.