How to create a CosyVerif-like build system

In order to create a build system similar to the one CosyVerif has, you'll first have to clone the following git repository, where is located all the scripts and files you need to create a Jenkins slave and a debian repository properly configured : https://github.com/CosyVerif/images

Then, you have to download a package that is located in the CosyVerif repository. The name of this package is genvm. Here's how to download packages from the said repository.

Before executing anything, there are some files you need to edit in order to create the jenkins slave and the repository you want.

1. The authorized_keys files

There are two authorized_keys files. The first, which is located in data/home/jenkins/.ssh/authorized_keys, is intended for the jenkins slave that you want to create. This is where you should put the public ssh key of the machine where Jenkins is installed, and others, if you want to.
The second file is located in data/home/repo/.ssh/authorized_keys, and is for the repository that will be created.

2. The repository file (apache)

Coming soon ...

3. The .dput.cf file

Coming soon ...

4. The .mini-dinstall.conf file

Coming soon ...

5. The gpg-keygen.conf file

Coming soon ...

Creating the VMs

Now that all the above configuration files have been filled, you can use the script create_buildcosy to create the virtual machines that will contains the repository and the jenkins slave. Although this script does not require any argument, you might want to use some. Here is a list of all the options of that script :

Once the script has finished its execution (it may takes some time ...), you should have two virtual disk images. There's still some things you have to do. You have to launch the virtual machine which contains the jenkins slave and generate its ssh key. In order to do so, you have to execute the following command:

ssh-keygen

This command will ask you in which directory you want to put the key that will be generated. Choose the default value, which is something like /home/jenkins/.ssh.

When this is done, you have to put the content of the file named id_rsa.pub in the authorized_keys file of the repository (located in /home/repo/.ssh/). Then, you have to launch the jenkins slave, and connect to the repository via ssh. It's mandatory to do so, because during the first connection, ssh will ask you if the machine you want to connect to is the right one. And you don't want that to happen during a build.