electricitymaps / brick

Simple monorepo build tool based on Docker
20 stars 1 forks source link

Brick develop now also mounts prepare steps #82

Closed corradio closed 3 years ago

corradio commented 3 years ago

Use-case: updating dependencies using only brick

Consider a BUILD.yaml like this:

steps:

  prepare:
    image: python:3.6
    inputs:
      - pyproject.toml
      - poetry.lock
    commands:
      - pip install poetry==1.1.4
      - poetry config virtualenvs.create false
      - poetry install

  develop:
    command: bash

  build:
    inputs:
      - debugger
    commands:
      - PYTHONPATH=.. poetry run pylint -E debugger

If one wants to update some python dependencies, one could edit the poetry.toml file, and then run brick develop to get a shell inside the container, before running poetry update which will update the lockfile. It's imperative that the inputs from the prepare step are added as volumes, in addition to any inputs from the develop and build steps. This PRs makes sure the prepare step inputs are also added as volumes.

This is helpful in cases where someone is not able to run poetry locally.