Build Process
From BCCD 3.0
(→Legacy process details) |
(→Improved process) |
||
Line 44: | Line 44: | ||
= Improved process = | = Improved process = | ||
- | See the [[Talk:Build Process|talk page]] | + | See also: the [[Talk:Build Process|talk page]] |
+ | |||
+ | == Build stages == | ||
+ | |||
+ | The improved process is a Make-/[[Jenkins]]-driven pipeline consisting of the following stages: | ||
+ | |||
+ | === <code>debootstrap</code> === | ||
+ | |||
+ | ; Artifact : <code>target/debootstrap.tar.bz2</code> | ||
+ | ; Make target : <code>target/debootstrap.tar.bz2</code> | ||
+ | ; Triggers : | ||
+ | |||
+ | Produces the artifact by running the <code>bin/prepare_debootstrap</code> script. | ||
+ | |||
+ | === <code>debootstrap-bccd</code> === | ||
+ | |||
+ | ; Dependencies : <code>target/debootstrap.tar.bz2</code>, <code>build/etc/bccd-revision</code> | ||
+ | ; Artifact : <code>target/debootstrap-bccd.tar.bz2</code> | ||
+ | ; Make target : <code>target/debootstrap-bccd.tar.bz2</code> | ||
+ | ; Triggers : | ||
+ | |||
+ | 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> | ||
+ | |||
+ | === <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 : | ||
+ | |||
+ | Generates <code>bccd.noarch.deb</code> using <code>rpm</code> and the checked-out files in the <code>src</code> directory. | ||
+ | |||
+ | === <code>iso</code> === | ||
+ | |||
+ | ; Dependencies : <code>target/bccd.noarch.deb</code>, <code>build/etc/bccd-revision</code>, <code>target/debootstrap-bccd.tar.bz2</code> | ||
+ | ; Make target : <code>target/bccd.amd64.iso</code> |
Revision as of 21:49, 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
Produces the artifact by running the bin/prepare_debootstrap
script.
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
Unpacks target/debootstrap.tar.bz2
, runs bin/bccd_install_pkgs
within it, and then creates target/debootstrap-bccd.tar.bz2
fpm
- Artifact
-
target/bccd.noarch.deb
,build/etc/bccd-revision
- Make target
-
target/bccd.noarch.deb
- Triggers
Generates bccd.noarch.deb
using rpm
and the checked-out files in the src
directory.
iso
- Dependencies
-
target/bccd.noarch.deb
,build/etc/bccd-revision
,target/debootstrap-bccd.tar.bz2
- Make target
-
target/bccd.amd64.iso