Support for continuous integration of Aseba software components in Jenkins 2 and in Docker.
If this repository is declared as a Jenkins global library, it will provide a pipeline step function CMake that will configure, make, and install a program. The function accepts the following arguments:
labeloptional subdirectory to append tobuildDirandinstallDirbuildDirwhere to compile (default: workDir + '/build/' + label)sourceDirwhere to find the source (default: workDir)installDirwhere to install (default: workdir + '/dist/' + label)cleanBuildshould buildDir be emptied first (default: true)buildTypeCMake build type (default: 'Debug')getGeneratorwhich build generator (default: 'Unix Makefiles')makeInvocationhow to build (default: 'make')makeInstallInvocationhow to install (default: 'make install')getCmakeArgs: additional CMake arguments, list or single string (no default)getArgumentss: additional CMake arguments, list or single string (no default)preloadScript: commands to run first (no default)
This function is a stopgap, waiting for the official CMake plugin to catch up with Jenkins Pipeline (see JENKINS-34998 Make CMake plugin compatible with pipeline). Its arguments try to match CMake Build Configuration. Like the official plugin, this function runs both CMake and a build invocation (make, make install).
The CMake step constructs a Bash script that is then executed, using a shell step if run on Unix, or a powershell step if run on Windows. The script is written to the console log so that it can be run manually if desired.
The utility function FindAvailableNodes will filter a list of candidate node labels, by default ['debian','windows','macos'], and only return those that are available in the current Jenkins instance. This can be used to build multi-OS pipelines where some OSes may not be available at a given time.
The directory resources/buildfarm contains Ansible playbooks to install development environments for Linux, macOS, and Windows, with prerequisites for compiling Aseba. It will be necessary to customize the hosts inventory to reflect your particular installation.
Jenkins can be run in a Docker container to provide a Debian build environment. The directory resources/buildfarm/docker contains a Dockerfile that will install Aseba prerequisites for building on the master node, and Jenkins plugins needed to run the Aseba Jenkinsfiles.