-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (45 loc) · 1.94 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.PHONY: docker-tests
# Build container
build:
docker build -t eo3:test .
# Full rebuild without the cache (useful periodically to get security updates)
clean-build:
docker build --no-cache -t eo3:test .
# Lint and test in one go.
check:
docker run --rm --volume "${PWD}":/tests -w /tests eo3:test ./check-code.sh
# Run tests in Docker
test:
docker run --rm --volume "${PWD}":/tests -w /tests eo3:test /tests/run-tests.sh
# Run tests in Docker as container root user
#
# (Eg. Github Actions has file write permission issues to external volumes when not using root,
# and we want to write test coverage etc. to the volume.)
test-root:
docker run --rm --volume "${PWD}":/tests --user root -w /tests eo3:test /tests/run-tests.sh
# Run linters in Docker
lint:
docker run --volume "${PWD}":/tests -w /tests eo3:test pre-commit run -a
# Run Tests in Docker as container root user
#
# (Eg. Github Actions has file write permission issues to external volumes when not using root,
# and we want to write test coverage etc. to the volume.)
lint-root:
docker run --user root -w /code eo3:test pre-commit run -a
# Lint the Dockerfile itself
# (hadolint has too many false positives to run in CI, but is useful for reference)
lint-dockerfile:
docker run --rm -i hadolint/hadolint < Dockerfile
# Interactive shell, with code mounted to /tests
shell:
docker run -it --rm --volume "${PWD}:/tests" --user root -w /tests eo3:test /bin/bash
# Update pinned dependencies using Docker's python
dependency-update:
docker run --rm --volume "${PWD}":/tests --user root -w /tests eo3:test bash -c 'make internal-update'
# Update dependencies directly
# This has to be run using the same Python interpreter we are deploying with.
# ie. Use "make dependency-update" instead!
internal-update:
pip-compile -r requirements/setup.in
pip-compile -r --extra docker --extra deployment -o requirements/deployment.txt
pip-compile -r --extra docker --extra test -o requirements/test.txt