spiff-element-units/Makefile

55 lines
1.4 KiB
Makefile
Raw Normal View History

2023-04-12 17:15:05 +00:00
SRC := spiff_element_units
TESTS := tests
2023-04-12 18:25:12 +00:00
TEST_DATA_DIR := $(TESTS)/data
PROCESS_MODELS_DIR := $(TEST_DATA_DIR)/process-models
SPECS_JSON_DIR := $(TEST_DATA_DIR)/specs-json
2023-04-12 18:31:35 +00:00
# Used to move back and forth between the process-models clone
CDUP_TO_PROCESS_MODELS_CLONE_DIR := ../../jbirddog/process-models
CDUP_BACK_TO_THIS_CLONE_DIR := ../../sartography/spiff-element-units
2023-04-12 16:30:45 +00:00
DEV_SERVICE := dev
2023-04-12 17:15:05 +00:00
MY_USER := $(shell id -u)
MY_GROUP := $(shell id -g)
ME := $(MY_USER):$(MY_GROUP)
2023-04-12 18:25:12 +00:00
AS_ME := docker compose run -u $(ME)
DEV_AS_ME := $(AS_ME) $(DEV_SERVICE)
2023-04-12 17:15:05 +00:00
2023-04-12 16:30:45 +00:00
.PHONY: all
all: dev-env
dev-env:
docker compose build --progress=plain $(DEV_SERVICE)
2023-04-12 17:15:05 +00:00
.PHONY: tests
tests:
$(DEV_AS_ME) unittest-parallel -vs $(TESTS) -p test_\*.py -t .
2023-04-12 18:25:12 +00:00
2023-04-12 20:29:23 +00:00
#
# used to copy in/parse files from my process-models, probably will want to move these to
# their own repo at some point? thought about a submodule but I don't really love them.
#
2023-04-12 18:25:12 +00:00
.PHONY: copy-process-models
copy-process-models:
rm -rf $(PROCESS_MODELS_DIR)
mkdir -p $(PROCESS_MODELS_DIR)
2023-04-12 18:31:35 +00:00
cd $(CDUP_TO_PROCESS_MODELS_CLONE_DIR) && \
find . -name "*.bpmn" -exec rsync -R {} $(CDUP_BACK_TO_THIS_CLONE_DIR)/$(PROCESS_MODELS_DIR) \;
2023-04-12 20:29:23 +00:00
.PHONY: script-specs-json
script-specs-json:
rm -rf $(SPECS_JSON_DIR)
$(DEV_AS_ME) python scripts/specs_json.py
#
# one off tasks
#
.PHONY: owner-check
owner-check:
find . ! -user $(MY_USER) ! -group $(MY_GROUP)