-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (53 loc) · 1.75 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
59
60
61
62
63
64
65
66
67
68
69
GIT_HASH := $(shell git rev-parse HEAD)
all: build test
.PHONY:
pull:
for image in `find -name Dockerfile | xargs grep --no-filename FROM | awk '{print $$2}' | sort -u`; do docker pull $$image; done
.PHONY:
build:
docker build -t c2corg/v6_images:latest --build-arg "GIT_HASH=$(GIT_HASH)" .
.PHONY:
run: build
docker-compose up
.PHONY:
latest:
docker pull docker.io/c2corg/v6_images:latest
docker-compose up
.build/venv/bin/python .build/venv/bin/pip:
python3 -m venv .build/venv
.build/venv/bin/py.test: requirements_host.txt requirements.txt .build/venv/bin/python
.build/venv/bin/pip install -r requirements_host.txt -r requirements.txt
.PHONY:
test-inside: build
docker run --rm -v $$PWD/data:/data c2corg/v6_images:latest rm -rf /data/incoming/* /data/active/* /data/.minio.sys/format.json /data/.minio.sys/multipart /data/.minio.sys/tmp
docker-compose stop || true
docker-compose rm -f || true
docker-compose run --rm wsgi scripts/launch_inside_tests.sh
docker-compose stop || true
docker-compose rm -f || true
docker run --rm -v $$PWD/data:/data c2corg/v6_images:latest rm -rf /data/incoming/* /data/active/* /data/.minio.sys/format.json /data/.minio.sys/multipart /data/.minio.sys/tmp
.PHONY:
test-outside: .build/venv/bin/py.test build
.build/venv/bin/py.test -v tests/wsgi; ERROR=$$?; [ 0 -eq $$ERROR ] || (scripts/show_logs.sh; exit $$ERROR)
.PHONY:
test: test-inside test-outside
.PHONY:
check: test
.PHONY:
logs:
scripts/show_logs.sh
.PHONY:
enter:
docker exec -it v6_images_wsgi_1 bash
.PHONY:
clean:
rm -rf .build .cache
find . -type f -path '*/__pycache__/*' -delete
find . -type d -name __pycache__ -delete
.PHONY:
cleanall: clean
rm -rf active/* incoming/*
.PHONY:
publish: clean
scripts/travis-build.sh
scripts/travis-publish.sh