Skip to content

Building sites that use multiple git repositories

Philip Colmer edited this page Aug 2, 2019 · 7 revisions

Some of the Linaro web sites (e.g. 96Boards) require more than one git repository to be combined to produce the correct source material from which Jekyll will build the site.

The approach taken is that each of the repositories contains a manifest file which informs the build process how the combination needs to be constructed. Here is the manifest file for the 96Boards web site:

NSBREPO1,https://github.com/96boards/website.git,/
NSBREPO2,https://github.com/96boards/documentation.git,/_documentation

It is a straightforward CSV file with three fields:

  • The name of an environment variable which, if set, points to a directory on your computer where a local copy of this repository can be found, e.g.:

    NSBREPO2=../96b-documentation ./build-site.sh

  • The HTTPS URL that can be used to fetch the repository if you don't have a copy of it locally.

  • Where in the combined sources directory the files from this repository should be copied.

As a minimum, it is possible to work on just one of the repositories used in building a site then run the build-site.sh script and the build process will automatically take care of the rest, including downloading any missing repositories.

The built copy of the site is placed in the same directory that you are running the build-site.sh script from. So, for example, if you are in the 96Boards documentation directory and run the script, a directory called staging.96boards.org or production.96boards.org will be created there with the site inside it. There will also be a directory called merged_sources created which is where the combination of all of the repositories is placed.