How to prepare a worker to build/test your projects
Preparing a virtual machine
- Install an operating system into a virtual machine.
- Inside the virtual machine, edit /etc/rc.d/rc.local (or /etc/rc.local) like this:
#!/bin/bash id build > /dev/null if [ "${?}" != "0" ]; then adduser build fi while [ 1 ]; do mount LABEL=RG /mnt if [ "${?}" != "0" ]; then sleep 1 continue fi /mnt/rg.sh >/mnt/rg.log 2>&1 break done 1>/dev/null 2>&1 < /dev/null &
and make it executable (and, optionally, restore context):
chmod a+x /etc/rc.d/rc.local restorecon -v /etc/rc.d/rc.local
Preparing the worker machine
- Install rocketgit software on a machine
- Edit /etc/rocketgit/worker.conf (start with .sample file)
- Edit /etc/cron.d/rocketgit: uncomment the worker.sh line
Sample worker.conf:
type = user user = my_rocketgit.com_user name = Builder 1 master = r1.example.net port = 65000 state = /var/lib/rocketgit/worker key = this_is_the_key_used_when_the_worker_was_added env = fedora-server-24-x86_64 type = libvirt arch = x86_64 image = /var/lib/libvirt/images/rgw/fedora-server-24-x86_64.qcow2 pkg_cmd = dnf -y install os-variant = fedora22
Now, you can add this worker into your account (Settings / Worker or Admin / Worker)
To debug the problems with the worker, check /var/log/rocketgit/worker-*.log