Although you can compile PlanetaryImager from sources, the best way to build Linux and Windows packages is to use Docker containers, together with a python script building images and packages.
git clone https://github.com/GuLinux/PlanetaryImager PlanetaryImager
PlanetaryImager
directorypython3 ./support/docker/docker.py package -i <image_name> -d <destination_directory>
You can view all the available images by running:
python3 ./support/docker/docker.py list
Main entry point for the build system and CI settings file management. Inside it you can notice a list of images:
images = [
Ubuntu('19.04', 'x86_64'),
Ubuntu('19.04', 'arm32v7'),
Ubuntu('18.04', 'x86_64'),
Ubuntu('18.04', 'arm32v7'),
Ubuntu('16.04', 'x86_64'),
Ubuntu('16.04', 'arm32v7'),
Debian('stretch', 'x86_64'),
Debian('stretch', 'arm32v7'),
Debian('buster', 'x86_64'),
Debian('buster', 'arm32v7'),
Fedora('29', 'x86_64'),
Fedora('30', 'x86_64'),
Fedora('31', 'x86_64'),
Windows('x86_64', 'static'),
]
Each image is a python class (Ubuntu
extends Linux
which extends Dockerfile
). This is where a new OS or OS version can be added. Additionally you can see that you can specify an architecture (either arm32v7
or x86_64
, i386
or i686
are deprecated, but possibly can be supported too).
This Dockerfile class representation is used to create a docker image that's going to be used in Travis to build the project for that particular distribution.
The docker.py --help
command will show a list of available commands for building images, pushing them to docker hub and generate the .travis.yml
file.
It also has a package
subcommand, which can be used both to test images locally and build packages. Travis also uses the docker.py package
command to generate new packages.
This directory contains the Dockerfile
snippets that are going to be interpolated and concatenated by the Dockerfile
python classes to generate a single Dockerfile
to create the docker image. It can contains variables in the form of %{Variable_Name}
that will be interpolated by the python classes.
This directory contains files that will be used during the build process.
shell script that will be run by default by the docker image
CMake configuration file that will be passed to the build system via the cmake -C <initial-cache>
command argument. For instance in debian it will set the CPACK_GENERATOR
variable to DEB
and sets the debian dependencies.
If the distribution supports it (currently .deb.
and .rpm
are supported) this script will install the generated package into the docker subsystem in order to check its consistency.
The command docker.py generate-travis-yml
will create the travis.yml
configuration file and dump it to stdout (if you're happy with it, you can use a regular shell redirection to write it to the project root .travis.yml
file).
It will collect all the configured docker images (the list present in docker.py
) and create a build matrix with a different environment for each one of them.
It also accepts the following parameters:
-e|--exclude-image <image-filter>
exclude images matching the <image-filter>
pattern from Travis build. At the moment of writing, I'm excluding arm images from the build, since they're too slow (they have to run with qemu-arm-static
)-s|--skip-tests <image-filter>
skips running tests on images that contain the <image-filter>
parameter. This can be useful to skip running Windows tests (executables) on a Linux docker container, for instance, or running Arm tests which are going to be very slow.Other travis parameters such as trigger conditions, environment variables, scripts and commands invoked are hardcoded in the travis.py
file.