Sat Nov 18 18:11:09 2017 UTC

Build bot Setup

Introduction

[Important] [Important] [Important] [Important] It's highly recommended to know NuTyX very well to succeed with this tutorial.
All the manipulations MUST BE done in the same SINGLE terminal. Do no use more then one terminal.

Each step

We will:

  1. get the tools
  2. put the user folders in place
  3. get all the recepts
  4. put the script folders in place
  5. get the binaries from the remote server
  6. set up the configuration files
  7. Launch the script

Setting up the tools (packages to install)

We assume that your NuTyX is clean from any devel package. We start to install all the utilities:

get rsync git

Configuration of the architecture

The first variable we need is the architecture definition (32 or 64 bits):

ARCH=`uname -m`

Version to use

NuTyX packages are in 3 versions available. Once you decide on which version you want to work, make a copy/paste of the last colomn variables.

List of available versions, copy/paste the correct variables depending on your choice:
stable stable
VERSION=stable
BRANCH=stable
current current
VERSION=current
BRANCH=current
development master
VERSION=development
BRANCH=master

Structure des projets disponibles

Choose the collection and the project you're going to work with. Once you made your choice, copy/paste defined variables in the last colomn.

Available collections list per project, copy/paste the variables depending your choice:
base base-sysV
PROJECT=base-sysV
COLLECTION=base
RSYNC=(base)
cli core
PROJECT=core
COLLECTION=cli
RSYNC=(base cli)
gui core
PROJECT=core
COLLECTION=gui
RSYNC=(base cli gui)
cli-extra extra
PROJECT=extra
COLLECTION=cli-extra
RSYNC=(base cli cli-extra)
gui-extra extra
PROJECT=extra
COLLECTION=gui-extra
RSYNC=(base cli gui cli-extra gui-extra)
mate and mate-extra mate
PROJECT=mate
COLLECTION=mate
RSYNC=(base cli gui mate mate-extra)
gnome and gnome-extra gnome
PROJECT=gnome
COLLECTION=gnome
RSYNC=(base cli gui gnome gnome-extra)
xfce4 and xfce4-extra xfce4
PROJECT=xfce4
COLLECTION=xfce4
RSYNC=(base cli gui xfce4 xfce4-extra)
kde5 and kde5-extra kde5
PROJECT=kde5
COLLECTION=kde5
RSYNC=(base cli gui kde5 kde5-extra)
nup and nup-extra nup
PROJECT=nup
COLLECTION=nup
RSYNC=(base cli gui nup nup-extra)

The git user folder in place

A build bot requires a lot of space.

At least 10 Gb of space is perfect.

All the folders needed are in:

/srv/www/
and
/home/$USER/git/$VERSION

All the receipts will be in our personnal folder.

We can now create the user git folder with our own account:

mkdir -pv /home/$USER/git/$VERSION
mkdir: created directory '/home/me/git'
mkdir: created directory '/home/me/git/current'

Get all the ports of the "$COLLECTION" from git location

We will synchronise the status of all the ports of the $COLLECTION for the compilation:

git clone -b $BRANCH https://github.com/NuTyX/$PROJECT.git ~/git/$VERSION/$PROJECT

We now create all the folders needed for the script:

sudo mkdir -pv \
/srv/www/{logs/$ARCH/$VERSION/$COLLECTION,$ARCH/$VERSION/$COLLECTION,sources}

Get all the binaries define in the $RSYNC variable from the remote server

This command might take some time if your connection is not very fast.

[Note] You need to type this command every time you want to resync your local copy with the remote server.
for i in ${RSYNC[@]}
do
  sudo rsync -av --delete rsync://downloads.nutyx.org/nutyx/$ARCH/$VERSION/$i/ \
  /srv/www/$ARCH/$VERSION/$i/
done

The /etc/fstab configuration file

We need to adjust 1 existing file

sudo echo "
#    PROJECT $PROJECT
##   COLLECTION $COLLECTION
###  VERSION $VERSION
#### GIT
/home/$USER/git/$VERSION/$PROJECT \
/$VERSION/$COLLECTION/root/$PROJECT none noauto,bind" \
| sudo tee --append /etc/fstab

Finalisation and step to reproduce

You're now ready to work with the compilation script. The command below needs to be reproduce in three cases:

  • The first time.
  • When you did something wrong with your chroot and then with your own binaries.
  • When you want to come back on the official binaries from the server.
for i in ${RSYNC[@]}
do
  sudo rsync -av --delete rsync://downloads.nutyx.org/nutyx/$ARCH/$VERSION/$i/ \
  /srv/www/$ARCH/$VERSION/$i/
done

Let's go

If you have done all the steps correctly, you should be able to start the compilation of all the ports of the project $PROJECT.

sudo ROOTMOUNT=/srv/www build-collection /$VERSION/$COLLECTION
CHROOT: <your collection>
COLLECTION: <your collection>
VERSION: <your version>
The command: KERNEL=NONE LFS=/<your version>/<your collection> DEPOT=/DEPOT install-nutyx
DEVEL: cards.devel &&
cd /root/<your collection> &&
bash scripts/<your collection> -a &&
bash scripts/<your collection>-extra -a  OK ? (y)
y