Member-only story

batect: Build and Test Environments as Code — With a Python Sample Project.

Sven Balnojan
7 min readAug 30, 2019
batect: auto downloads itself on first activation. Listing possible tasks to be run.

How long does it take you to onboard a new colleague? It takes roughly two weeks to get someone outfitted with all dev, build and test environments. The concept of Build and Test Environments as Code tries to take that trouble away.

And the tool batect makes that possible within Docker.

In the words of the “go script concept”: “You know you’re on a mature dev team when your instructions as a new team member are: check out the repo, run ./batect — list-tasks, ./batect setup, and you’re done.

I’ll show you how to use batect in a Python context. We will:

  • setup batect.
  • use batect to put the python dependency management into code, without writing down a convention to have virtual environments in some magic place.
  • use batect to cache dependencies in docker build steps, and to have them locally available.
  • use batect to shell into docker containers right after the setup phase.
  • use batect to run an integration test on top of this setup against a Postgres.

--

--

Sven Balnojan
Sven Balnojan

Written by Sven Balnojan

Head of Product at MAIA | PhD, ex Head of Mkt | Author | AI & Data Expert | Newsletter at http://thdpth.com/

Responses (1)