Since we will use Git as repository, if not already present, install Git Plugin for Jenkins,
We will use Jenkins to automate a cross platform software that is built from a single repository. In order to use Jenkins, we will install Jenkins Slave in build machines, and a Jenkins master (regular Jenkins instance) will orchestrate these. First let’s prepare a Debian build system. We assume all necessary build tools (make, g++) and libraries (libpcap, libpq) are already present. Install Jenkins slave agent to build machine,
First obtain keys,
Then add package source of Jenkins to /etc/apt/sources.list
Then perform an update ( apt-get update) and install Jenkins.
We also should generate ssh keys
Public keys should be added to git side so that build systerm can connect to Git repository. First if not already created, create a git server, install git (apt-get install git). Create a new user called ‘git’
Create an authorized_keys file, which will be container of public keys of git clients,
Then this public key should be appended to authorized_keys file.
Create an empty git repository
After populating repository, start with configuring Jenkins master side. If not already installed, install ssh plugin through plugin manager. Master will connect remote through this ssh plugin,
Now create a new job that will be used, this may be done through “Manage Jenkins” and “Manage Nodes” section
Create a new dump slave node, name it “capturer debian”, which will be our debian build system to prepare capturer in this os.
Configure host, working directory and credentials for slave connection,
We should see slave and, the connection should be established,
Since we will use remote ssh in order to build, define a remote ssh agent using global configuration menu,
Then create a new freestyle item,
And configure newly created item. We schedule it to be daily executed, only in remote slave “capturer debian” and through ssh shell commands as given below.
If everything is as expected, we may start a build which will execute successfully.
To see process details, we may refer to console output as,
Next may be configuring git repository so that it should trigger a build when there is a change, rather than polling or using scheduled builds.