-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (63 loc) · 2.42 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
70
71
72
73
74
75
76
77
78
79
80
81
82
LANG=en_US.utf-8
export LANG
Pipfile.lock: Pipfile
docker compose run --rm --name sam_fhir dev sh -c "rm -f Pipfile.lock && pipenv lock --dev"
.PHONY:devdocker
devdocker: ## Builds the docker for dev
docker compose build --no-cache
.PHONY:init
init: devdocker up setup-pre-commit ## Initializes the local developer environment
.PHONY: up
up: Pipfile.lock
docker compose up --build -d
.PHONY: down
down: ## Brings down all the services in docker-compose
export DOCKER_CLIENT_TIMEOUT=300 && export COMPOSE_HTTP_TIMEOUT=300
docker compose down --remove-orphans && \
docker system prune -f
.PHONY:clean-pre-commit
clean-pre-commit: ## removes pre-commit hook
rm -f .git/hooks/pre-commit
.PHONY:setup-pre-commit
setup-pre-commit: Pipfile.lock
cp ./pre-commit-hook ./.git/hooks/pre-commit
.PHONY:run-pre-commit
run-pre-commit: setup-pre-commit
./.git/hooks/pre-commit
.PHONY:update
update: down Pipfile.lock setup-pre-commit ## Updates all the packages using Pipfile
docker compose run --rm --name sam_fhir_pipenv dev pipenv sync --dev && \
make pipenv-setup && \
make devdocker
.PHONY:tests
tests: up
docker compose run --rm --name sam_fhir_tests dev pytest tests
.PHONY:continuous_integration
continuous_integration: run-pre-commit
docker compose run --rm --name sam_fhir dev python setup.py install && \
pytest tests
.PHONY: sphinx-html
sphinx-html:
docker compose run --rm --name sam_fhir dev make -C docsrc html
@echo "copy html to docs... why? https://github.com/sphinx-doc/sphinx/issues/3382#issuecomment-470772316"
@rm -rf docs
@mkdir docs
@touch docs/.nojekyll
cp -a docsrc/_build/html/. docs
.PHONY:classes-debug
classes-debug:
docker compose run --rm --name sam_fhir dev python3 spark_auto_mapper_fhir/generator/generate_classes.py > out.txt
.PHONY:classes
classes:
docker compose run --rm --name sam_fhir dev python3 spark_auto_mapper_fhir/generator/generate_classes.py && \
make run-pre-commit
.PHONY:pipenv-setup
pipenv-setup:devdocker ## Run pipenv-setup to update setup.py with latest dependencies
docker compose run --rm --name sam_fhir dev sh -c "pipenv run pipenv install --skip-lock --categories \"pipenvsetup\" && pipenv run pipenv-setup sync --pipfile" && \
make run-pre-commit
.PHONY:shell
shell:devdocker ## Brings up the bash shell in dev docker
docker compose run --rm --name sam_fhir_shell dev /bin/bash
.PHONY:build
build: ## Builds the docker for dev
docker compose build --progress=plain --parallel