-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
38 lines (28 loc) · 1.55 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export DOCKER_BUILDKIT := "1"
# technically, these could differ by 1 seconds, but thats unlikely and doesn't matter
# human readable, used as label in docker image
export BUILD_DATE := `date +'%y-%m-%dT%H:%M:%S.%3NZ'`
# monotonic, used as label in docker image *and* in docker tag
export BUILD_NUMBER := `date +'%y%m%d%H%M%S'`
export REVISION := `git rev-parse --short HEAD`
# build docker image for version
build version target="python" *args="":
docker compose --env-file {{ version }}/env build --pull {{ args }} {{ target }}
# test docker image for version
test version *args="tests -v": (build version)
docker compose --env-file {{ version }}/env run --rm -v $PWD:/workspace python pytest {{ args }}
# run pip-compile to add new dependencies, or update existing ones with --upgrade
update version *args="":
docker compose --env-file {{ version }}/env run --rm -v $PWD:/workspace base pip-compile {{ args }} {{ version }}/requirements.in -o {{ version }}/requirements.txt
{{ just_executable() }} render {{ version }}
{{ just_executable() }} test {{ version }}
# render package version information
render version *args:
docker compose --env-file {{ version }}/env run --rm -v $PWD:/workspace python ./scripts/render.py {{ args }} > {{ version }}/packages.md
# run linters
check:
@docker pull hadolint/hadolint:v2.12.0
@docker run --rm -i hadolint/hadolint:v2.12.0 < Dockerfile
# publish version (dry run by default - pass "true" to perform publish)
publish version publish="false":
PUBLISH={{ publish }} ./scripts/publish.sh {{ version }}