Conduct API¶
Build steps¶
Base classes¶
-
class
conduct.buildsteps.base.BuildStep(name, paramValues, chain=None)[source]¶ Parameters
-
condition(str)¶ Precondition for this build step. Step will be skipped if not fulfilled. Default value:
''.
-
description(str)¶ Build step description. Default value:
'Undescribed'.
-
loglevel(one of ['debug', 'info', 'warning', 'error'])¶ Log level. Default value:
'info'.
-
retries(int)¶ Number of retries to execute the build step. Default value:
0.
-
Debian specific build steps¶
-
class
conduct.buildsteps.deb.Debootstrap(name, paramValues, chain=None)[source]¶ Bases:
BuildStepThis build step bootstraps a basic debian system to the given directory.
Parameters
-
arch(str, mandatory in setup)¶ Desired architecture.
-
destdir(str, mandatory in setup)¶ Destination directory.
-
distribution(str, mandatory in setup)¶ Desired distribution.
-
includes(a list of str)¶ Packages to include. Default value:
[].
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.deb.InstallDebPkg(name, paramValues, chain=None)[source]¶ Bases:
BuildStepParameters
-
chrootdir(str)¶ Chroot directory (if desired). Default value:
''.
-
depsonly(bool)¶ Install dependencies only. Default value:
False.
-
pkg(str, mandatory in setup)¶ Package to install.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.deb.PBuilderExecCmds(name, paramValues, chain=None)[source]¶ Bases:
BuildStepExecute commands inside a pbuilder jail.
Parameters
-
cmds(a list of str, mandatory in setup)¶ List of commands to execute.
-
config(str)¶ Pbuilder config file (pbuilderrc). Default value:
'/etc/pbuilderrc'.
-
save(bool)¶ Save jail after execution. Default value:
False.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.deb.Pdebuild(name, paramValues, chain=None)[source]¶ Bases:
BuildStepBuild debian package via pdebuild.
Parameters
-
config(str)¶ Pbuilder config file (pbuilderrc). Default value:
'/etc/pbuilderrc'.
-
sourcedir(str, mandatory in setup)¶ Source directory.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
Device file build steps¶
-
class
conduct.buildsteps.dev.DevMapper(name, paramValues, chain=None)[source]¶ Bases:
BuildStepThis build step uses kpartx (devmapper) to map the partitions of the given device to own device files.
Parameters
-
dev(str, mandatory in setup)¶ Path to the device file.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.dev.Partitioning(name, paramValues, chain=None)[source]¶ Bases:
BuildStepParameters
-
dev(str, mandatory in setup)¶ Path to the device file.
-
partitions(a list of Referencer or int, mandatory in setup)¶ List of partition sizes (in MB).
Parameters inherited from the base classes:
condition,description,loglevel,retries-
File system build steps¶
-
class
conduct.buildsteps.fs.CopyPath(name, paramValues, chain=None)[source]¶ Bases:
BuildStepThis build step copies a path to a given destination path. Shell wildcards are supported!
Parameters
-
destination(str, mandatory in setup)¶ Destination path.
-
source(str, mandatory in setup)¶ Source path.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.fs.CreateFileSystem(name, paramValues, chain=None)[source]¶ Bases:
BuildStepThis build step creates the desired file system on the given device. Used tool: mkfs
Parameters
-
dev(str, mandatory in setup)¶ Path to the device file.
-
fstype(one of 'bfs', 'cramfs', 'ext2', 'ext3', 'ext4', 'fat', 'ntfs', 'vfat', mandatory in setup)¶ Desired file system.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.fs.MakeDirs(name, paramValues, chain=None)[source]¶ Bases:
BuildStepThis build step create the desired directories.
Parameters
-
dirs(a list of str, mandatory in setup)¶ List of directories.
-
removeoncleanup(bool)¶ Remove the directories on clenup. Default value:
True.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.fs.Mount(name, paramValues, chain=None)[source]¶ Bases:
BuildStepThis build step mounts given device to given mount point.
Parameters
-
dev(str, mandatory in setup)¶ Path to the device file.
-
mountpoint(str, mandatory in setup)¶ Path to the mount point.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.fs.MovePath(name, paramValues, chain=None)[source]¶ Bases:
BuildStepThis build step moves/renames a path to a given destination path. Shell wildcards are supported!
Parameters
-
destination(str, mandatory in setup)¶ Destination path.
-
source(str, mandatory in setup)¶ Source path.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.fs.RmPath(name, paramValues, chain=None)[source]¶ Bases:
BuildStepParameters
-
path(str, mandatory in setup)¶ Path to remove.
-
recursive(bool)¶ Remove recursive. Default value:
True.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.fs.TmpDir(name, paramValues, chain=None)[source]¶ Bases:
BuildStepParameters
-
parentdir(str)¶ Path to parent directory. Default value:
'/tmp'.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.fs.WriteFile(name, paramValues, chain=None)[source]¶ Bases:
BuildStepParameters
-
append(bool)¶ Append to the file (if existing). Default value:
False.
-
content(str, mandatory in setup)¶ Content wo write.
-
path(str, mandatory in setup)¶ Path to target file.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
Generic build steps¶
-
class
conduct.buildsteps.generic.Calculation(name, paramValues, chain=None)[source]¶ Bases:
BuildStepBuild step to do some calculation.
Parameters
-
formula(str, mandatory in setup)¶ Formula to calculate.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.generic.Config(name, paramValues, chain=None)[source]¶ Bases:
BuildStepBuild step to read given configuration file.
Parameters
-
format(one of 'ini', 'py', 'auto')¶ Format of config file. Default value:
'auto'.
-
path(str)¶ Path to the configuration file. Default value:
'.'.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.generic.Map(name, paramValues, chain=None)[source]¶ Bases:
BuildStepMaps a value to another one. Supports regex matching and priority matching by order.
Parameters
-
input(str, mandatory in setup)¶ Input to map.
-
mapping(OrderedDict, mandatory in setup)¶ Mapping ordered dict.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.generic.TriggerCleanup(name, paramValues, chain=None)[source]¶ Bases:
BuildStepBuild step that triggers the cleanup of another step.
Parameters
-
step(str, mandatory in setup)¶ Step to clean up.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
System call build steps¶
-
class
conduct.buildsteps.syscall.ChrootedSystemCall(name, paramValues, chain=None)[source]¶ Bases:
BuildStepBuild step to execute given shell command in a chroot environment.
Parameters
-
chrootdir(str)¶ Chroot directory. Default value:
'.'.
-
command(str, mandatory in setup)¶ command to execute.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
-
class
conduct.buildsteps.syscall.SystemCall(name, paramValues, chain=None)[source]¶ Bases:
BuildStepBuild step to execute given shell command.
Parameters
-
command(str, mandatory in setup)¶ command to execute.
-
workingdir(str)¶ Working directory for command execution. Default value:
'.'.
Parameters inherited from the base classes:
condition,description,loglevel,retries-
Colorizing stuff¶
Console coloring handlers.
Conduct configuration access¶
Custom logging¶
-
class
conduct.loggers.ColoredConsoleHandler[source]¶ Bases:
StreamHandlerA handler class that writes colorized records to standard output.
-
class
conduct.loggers.ConsoleFormatter(fmt=None, datefmt=None, colorize=None)[source]¶ Bases:
FormatterA lightweight formatter for the interactive console, with optional colored output.
-
class
conduct.loggers.LogfileFormatter(fmt=None, datefmt=None)[source]¶ Bases:
FormatterThe standard Formatter does not support milliseconds with an explicit datestamp format. It also doesn’t show the full traceback for exceptions.
-
extended_traceback= True¶
-
-
class
conduct.loggers.LogfileHandler(directory, filenameprefix, dayfmt='%Y-%m-%d')[source]¶ Bases:
StreamHandlerLogs to log files with a date stamp appended, and rollover on midnight.