Skip to content

ADR 8: Auto-updating build scripts

Context

Installation of a Python application using PIP is a simple task, but it may be not so trivial for someone who is not familiar with it. So it may be useful to provide some script for bootstrapping tools needed for building the course materials.

It is also important for all authors of the course to have the same version of the IT4KT Builder. At the same time, each course may use different version of the Builder.

Decision

We decided to include in the example course simple build scripts for Unix and Windows. The scripts perform three tasks:

  1. Create Python virtual environment in the directory pyvenv, if it does no exist.
  2. Install or update all requirements defined in requirements.txt using PIP.
  3. Run it4kt-builder auto.

Virtual environment is needed to isolate all courses so they can use different versions of the Builder. Requirements defined in the file allow to specify the version used by both scripts and also GitLab CI build job. Automatic update on every run would ensure that every author would have installed the same version as specified in the requirements.txt. And finally, IT4KT in the auto mode would watch the course directory and automatically rebuild it on every change and update page in the browser.

By default requirements.txt would not specify concrete version, so latest version of the Builder would be used, tracking all improvements in the Builder and themes.

Because IT4KT Builder is an internal project, it uses a custom package index. Its URL is also defined in the requirements.txt file.

Status

Accepted.

Consequences

The build scripts, would automatically install it4kt-builder package with all dependencies. The only thing that needs to be installed by the use is Python.

By default the scripts would update it4kt-builder to the latest version on each run. If the version is pinned in the requirements.txt, the scripts would ensure that all authors would have this version installed.

Auto-updating requires internet access and may slow down start of the builder. Auto-update may also break a course if some uncompatible change is introduced introduced in the Builder.