-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (72 loc) · 2.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
LANG=en_US.utf-8
export LANG
Pipfile.lock: Pipfile
docker compose run --rm --name spark_fhir_schemas 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:build
build: ## Builds the docker for dev
docker compose build --progress=plain --parallel
.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: Pipfile.lock setup-pre-commit ## Updates all the packages using Pipfile
docker compose run --rm --name sfs_pipenv dev pipenv sync --dev && \
make devdocker && \
make pipenv-setup
.PHONY:tests
tests: up
docker compose run --rm --name sfs_tests dev pytest tests
.PHONY: sphinx-html
sphinx-html:
docker compose run --rm --name spark_fhir_schemas dev make -C docsrc html
@echo "copy html to docs... why? https://github.com/sphinx-doc/sphinx/issues/3382#issuecomment-470772316"
@rm -rf docs/*
@touch docs/.nojekyll
cp -a docsrc/_build/html/. docs
.PHONY:pipenv-setup
pipenv-setup:devdocker ## Run pipenv-setup to update setup.py with latest dependencies
docker compose run --rm --name spark_data_frame_comparer 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 sfs_shell dev /bin/bash
.PHONY:schema-r4
schema-r4:
docker compose run --rm --name sfs_shell dev python3 spark_fhir_schemas/r4/generate_schema.py && \
make run-pre-commit
make run-pre-commit
.PHONY:schema-r4b
schema-r4b:
docker compose run --rm --name sfs_shell dev python3 spark_fhir_schemas/r4b/generate_schema.py && \
make run-pre-commit
make run-pre-commit
.PHONY:schema-stu3
schema-stu3:
docker compose run --rm --name sfs_shell dev python3 spark_fhir_schemas/stu3/generate_schema.py && \
make run-pre-commit
make run-pre-commit
.PHONY:schema-dstu2
schema-dstu2:
docker compose run --rm --name sfs_shell dev python3 spark_fhir_schemas/dstu2/generate_schema_file.py && \
docker compose run --rm --name sfs_shell dev python3 spark_fhir_schemas/dstu2/generate_schema.py && \
make run-pre-commit
make run-pre-commit