View Debian Pbuilder on the plugin site for more information.
Build Debian packages in Jenkins!
This plugin is based largely off of jenkins-debian-glue, however with support for builder packages in a proper Jenkins way.
Find pre-built versions on the private Jenkins instance here: https://jenkins.rm5248.com/job/debian-pbuilder/
Before you can successfully run the plugin, there are certain requirements that must be met on the node(s) that you wish to run on.
Install needed dependencies:
If building Debian packages on Ubuntu, make sure that the package debian-archive-keyring is installed
Like jenkins-debian-glue, make sure that sudo is configured properly. As taken from the jenkins-debian-glue webpage, add the following to either /etc/sudoers, or create a new file(e.g. /etc/sudoers.d/jenkins):
(this assumes that Jenkins is running under the Jenkins user)
Using the Plugin
There are two global configuration options. These options may be found by going to "Manage Jenkins" → "Configure System". The two options here are for the autobuilder email address, and the format for how the packages will be numbered.
This plugin may be configured as both a traditional Jenkins build, or as a Pipeline project.
- Create a new project. If you want to build for multiple architectures, select "Multi-configuration project"
- Checkout source code. When you checkout the source code for the project, it must be in a subdirectory called 'source'. This can be done as either an SVN repository, or a git repository. To checkout to the proper directory using git, go to "Additional Behaviors" and select "Check out to a sub-directory", and put "source" as the value. To checkout to the proper directory using SVN, under "Local module directory" put "source" as the value.
Under 'Build Environment', select 'Delete workspace before build starts'
If you have a matrix configuration project, add a new variable called "architecture". Put in the proper architectures to build for in this section; this must map to a valid architecture that exists in the distribution repos.
Under the 'Build' section, add 'Debian Pbuilder'. Most of these settings may be left at their default values, however it is highly recommended to fill in the "Distribution" and "Mirror Site" variables in order to ensure that you get a consistent build. Otherwise, pbuilder will use the defaults for whatever distribution you are currently running.
If you have custom pbuilder hook files that you want to install, install the Config File Provider to add in config files. Set the 'target' option to be `hookdir/<file-name>`.
If using pipeline, you may setup a job similar to the following:
By default the plugin will increment the current version number by reading 'debian/changelog'. The algorithm follows the standard Debian practice of packages having a ~ being a pre-release version, and packages with a + denoting a version greater than what is default. Note that this only happens if the the distribution set in 'debian/changelog' is UNRELEASED, or a tag is being built. Tags are automatically scanned; if using SVN or git, the environment variables SVN_URL_1 and GIT_BRANCH are scanned for the substring "tags/"; if the substring is found, the package will be built as a tag. Otherwise, you can also select the "Build as tag" to force the package to not increment the version number, or alternatively set the environment variable DEB_PBUILDER_BUILDING_TAG if you are building a tag.
All generated files are automatically added to the build artifacts for easy retrieval. This includes the deb files, as well as the dsc and tar files used to build the package in the pbuilder environment.
- Support for Pipeline jobs.
- Added configuration options for versioning
- Initial Release of software. Can build projects of multiple types.