modified version of jenkins debian glue (https://github.com/mika/jenkins-debian-glue) for devuan
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Michael Prokop 8fd5dc8fe8 Make Debian package a native one. 10 years ago
debian Make Debian package a native one. 10 years ago
git git hook: adjust file name information in header. 10 years ago
tests increase-version-number: handle version numbers with single digit as last version number part accordingly. 10 years ago
LICENSE License jenkins-debian-glue under MIT terms. 10 years ago
Makefile New script increase-version-number to raise version number for usage in a new snapshot number. 10 years ago
README.org README.org: slightly improve documentation regarding increase-version-number. 10 years ago
build-and-provide-package build-and-provide-package: include arch: all package in all architectures. 10 years ago
generate-git-snapshot Merge branch 'master' of https://github.com/formorer/jenkins-debian-glue into pull-request-1 10 years ago
generate-local-repository New scripts, initial debian/ packaging, initial documentation. 10 years ago
generate-reprepro-codename New scripts, initial debian/ packaging, initial documentation. 10 years ago
generate-svn-snapshot generate-svn-snapshot: use svn info for retrieving latest change in debian/changelog. 10 years ago
increase-version-number increase-version-number: handle version numbers with single digit as last version number part accordingly. 10 years ago

README.org

Background

This Debian package provides scripts for building Debian packages inside Jenkins (being a Continuous integration system). Currently being a test driven and user needs driven prototype it's meant to make Q/A builds of Debian packages inside Jenkins as manageable and homogeneous as possible.

System requirements

  • Jenkins

  • Cowbuilder

  • Reprepro

Setup instructions

Jenkins jobs for a given Debian package foobar needs to be named foobar-binaries and foobar-source. foobar-source is the job name where the source package is being built and foobar-binaries is the job name where the Debian binary packages are being built.

If a second job for an already existing job for the Debian package foobar should be available then the name foobar-test with the according Jenkins jobs foobar-test-source and foobar-test-binaries is supported.

Source job configuration (foobar-source)

Choose "This build is parameterized" to be able to build specific branches.

Enable and configure "Source Code Management", currently only Git is supported by the generate-git-snapshot script. (NOTE: Scripts for other version control systems are highly welcome!) Important: set the "Local subdirectory for repo (optional)" option under Advanced settings to "source".

Enable "Trigger builds remotely" and set an user-defined authentication token.

Use @daily inside "Poll SCM".

In the "Build" section add a build step "Execute shell" using:

/usr/bin/generate-git-snapshot auto

Under "Post-build Actions" select "Archive the artifacts" using:

*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes

Select the binaries job (foobar-binaries) under "Build other projects" with the "Trigger only if build succeeds" option enabled.

For "Files to deploy" enable "Deploy artifacts from workspace to remote directories" using:

*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes

and for the "Remote directory" use:

${JENKINS_HOME}/userContent/${JOB_NAME}/

Enable "Record fingerprints of files to track usage" and "Fingerprint all archived artifacts".

Binaries job configuration (foobar-binaries)

Add a "Configuration Matrix" with user-defined Axis titled "architecture" and values "amd64 i386", specifying the architectures that should be built. Choose "Run each configuration sequentially".

In the "Build" section add a build step "Execute shell" using:

/usr/bin/build-and-provide-package

Under "Post-build Actions" select "Archive the artifacts" using:

*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes

Scripts

  • build-and-provide-package: searches for newest package version in ${DSON_HOME}/userContent/${CKAGE}-source/ and uses the dsc file for building a binary package for the specific $ahitecture of the matrix build using cowbuilder. The resulting binary package will be installed in reprepro to provide it for usage via APT. i386 builds are binary-only builds (limited to architecture dependent packages) and amd64 builds are binary-only builds (no source files are to be built). With the amd64 build the original dsc file is being installed in reprepro as source package.

  • generate-git-snapshot: generates a snapshot version of a Debian package using git-dch. Use 'auto' as command line option to use git-dch's magic to build changelog, without the 'auto' option the version string will be build based on last tag/merge.

  • generate-local-repository: scans the current working directory for Debian packages and generates Packages.gz, Contents and Release files. Meant for usage if reprepro would be overkill (e.g. no signed repository is needed).

  • generate-reprepro-codename: takes a repository/codename as command line option and adds an according repository/codename definition to /srv/repository/conf/distributions (iff the codename is not present yet). As second command line option the GnuPG key ID for signing the repository can be specified (defaults to a static value otherwise).

  • generate-svn-snapshot: generates snapshot version of a Debian package using svn log, svn2cl and some dirty shell magic.

  • increase-version-number: takes a version number as commandline argument and raises the version number for usage inside as a new snapshot version. It does not append any special characters (like $BLD_NUMBER or VCS revisions), so you can use it with your own suffix, build numbers, VCS info, etc.

Known TODOs

  • Make configuration more flexible (key id, repository path, cowbuilder base dirs,…).

  • Separate cowbuilder and reprepro steps in build-and-provide-package (e.g. to use generate-local-repository instead of reprepro).

  • Make sure scaling with slave node works (including tagging of hosts, deploying files,…).

  • Provide Jenkins plugin to deploy and configure cowbuilder.

  • Provide Jenkins plugin to deploy and configure reprepro (including gpg key).

Author

Michael Prokop <mika@debian.org>