Automatically builds software from git repositories
Go to file
giomba 985e71b049 Updated documentation 2018-11-30 15:33:43 +01:00
lib First commit 2018-11-30 15:24:09 +01:00
repos-available First commit 2018-11-30 15:24:09 +01:00
repos-enabled First commit 2018-11-30 15:24:09 +01:00
var First commit 2018-11-30 15:24:09 +01:00 Updated documentation 2018-11-30 15:33:43 +01:00 First commit 2018-11-30 15:24:09 +01:00 First commit 2018-11-30 15:24:09 +01:00

dailybuilder for GOLEM

Daily builds given repositories.


Just copy (or soft link) an example config file in repos-enabled directory, and edit as you like. Use comments to understand meaning of various options.

How it works

cron must call the bash script at least once per day retrieves its settings in script.

Then it searchs for repositories config files in repos-enabled directory, and runs lib/ for each of them. exctracts the current repository settings from its config file, then looks for the $REPONAME file inside $LAST_PULL_DIR: if does not exist, then this is the first time that build is required for this repository, so it clones it and also prepares an output directory in the $OUTPUT_DIR directory. Else, if file exists, it means that the repository has already been pulled in the past, and file contains the Unix timestamp representing this event. So simply does a math calc to determine wether its "build time" is expired (eg, is run after 60 minutes from last pull of a daily repository, so nothing has to be done; eg, is run after 25hours from last pull of a daily repository, so the repository is flagged to be built).

If repository is flagged to be built, then changes its current path directory and goes inside the repository root, then pulls updates (if any), executes the given command in the repository config file (eg. ./configure && make), then copies the ojects given in the config file to the output dir (eg. build/release/binary.elf) and finally updates last Unix timestamp.

Tip: to test config, can also be run manually in its directory. Note that this could trigger the build of configured repositories and take some time, at least on first manual run.

Warning: no safety checks are done, so be very careful when doing anything!

Note: of course, the system that runs the dailybuilder must have installed all the dependencies needed for the configured repositories.

Crontab example: 30 * * * * cd ~/bin/dailybuilder/ && ./