Template Training

Update build system

Overview

  • Teaching: 15 min
  • Exercises: 0 min

Questions

  • How do I update my lesson to include new and wonderful functionality that you've developed?

Objectives

  • Understand that we are developing the build system and how to share it most effectively!

Build System Development

In order to support both the use of the template and ongoing development of te build system below we describe you how can incorporate new features into your lessons derived fromt the template. Currently we are not in position to deliver an independent build system, but this is certainly under consideration if the dependency stack can be made reasonable. Rest assured every effort will be made to ensure backwards compatability, however given the limited set of key words currently it is difficult to imagine this not being the case.

Development Branches

Individual contributers are advised to develop changes to the template repository under their own dev branches, with separate branches for developments to the tutorial and the build system. Any pull requests should then be made against the relevant development branch (tutorial_dev or build_dev). Once accepted these are then merged into the master branch ready to be released for general use.

For the user this means that in order to update their tutorial they just have to apply the most recent changes to build_dev. The process follows the advice on Github for configuring and synching a fork. In order to check that updating does not break your current build we recommend the following process, assuming that master is the primary development branch and that you have followed the instructions for duplicating the repository linked in episode 2.

On the first time you update the build system you will need to create a build_dev branch and add the upstream repository

  1. First change to the working directory of your lesson. From your master branch create a new build_dev branch, and switch to it with the command:

    % git checkout -b build_dev
    
  2. You will then need to add the upstream repository of the template (and check that it has added correctly by repeating step 2):

    % git remote add upstream https://github.com/arc-bath/template_jupyter.git
    

You can check that these are present by running

  1. Check that you have the build_dev branch:

    % git branch
    *build_dev
    master
    
  2. Check whether you have added the template as a remote upstream:

    % git remote -v
    origin  https://github.com/<your_username>/<your_lesson>.git (fetch)
    origin  https://github.com/<your_username>/<your_lesson>.git (push)
    upstream   https://github.com/arc-bath/template_jupyter.git (fetch)
    upstream   https://github.com/arc-bath/template_jupyter.git (push)
    
  1. In order to update you should switch to the build_dev branch if you have not already, note the branch preceeded by * when you ran git branch is your current branch.

    % git checkout build_dev
    Switched to branch 'build_dev'
    
  2. Fetch the branches on the current template repository:

    % git fetch upstream
    
  3. Merge the build system develpoment branch:

    % git merge upstream/build_dev
    
  4. Now check that your lesson builds first to do this you will need to merge you changes back into master:

    % git checkout master
    % git merge build_dev
    % make html
    

The separate build_dev branch allows us to ensure that you only receive updates to the build system, not the tutorial material for using the template.

Key Points

  • We have a couple of approaches:
    • Currently we use the method described above, possibly scripted in the future.
    • A more robust and usable apporach would ship the build system as its own package
  • We will endeavour to ensure backwards compatabilty
  • You may not need to worry because Jupyter will probably solve the problems we've tried to deal with.