2019-07-05 00:33:19 +00:00
|
|
|
##
|
|
|
|
# This Makefile provides the main development interface for working with Otto,
|
|
|
|
# and helps organize the various tasks for preparation, compilation, and
|
|
|
|
# testing.
|
|
|
|
#
|
2020-10-18 03:16:30 +00:00
|
|
|
# Execute `make` to get help for the various targets
|
2019-07-05 00:33:19 +00:00
|
|
|
################################################################################
|
2019-06-26 01:23:06 +00:00
|
|
|
|
2019-02-23 19:31:06 +00:00
|
|
|
################################################################################
|
|
|
|
## Phony targets
|
2021-03-03 19:34:57 +00:00
|
|
|
.PHONY: apispecs clean clean-db diagram help steps release run
|
|
|
|
SQLITE_DB=otto.db
|
2020-10-17 23:09:03 +00:00
|
|
|
|
2020-11-28 05:11:19 +00:00
|
|
|
# Cute hack thanks to:
|
|
|
|
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
|
|
|
help: ## Display this help text
|
|
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|
2020-11-22 18:47:13 +00:00
|
|
|
run: ## Convenience target for running services
|
|
|
|
./scripts/shoreman
|
|
|
|
|
|
|
|
release: ## Build release binaries of everything
|
2020-10-17 23:09:03 +00:00
|
|
|
cargo build --release
|
|
|
|
# Strip all the executables for size, does impact debug symbols
|
|
|
|
find target/release -type f -executable -exec strip {} \;
|
|
|
|
|
2020-11-22 18:47:13 +00:00
|
|
|
steps: release ## Package up all the stdlib steps as tarballs with osp
|
2020-10-17 23:09:03 +00:00
|
|
|
for dir in $$(find stdlib -maxdepth 1 -type d | tail -n +2); do \
|
|
|
|
echo ">> Packaging $$dir"; \
|
|
|
|
./target/release/osp $$dir; \
|
|
|
|
done;
|
|
|
|
|
2020-11-22 18:47:13 +00:00
|
|
|
apispecs: ## Run the OpenAPI-based specification tests, requires servers to be running already
|
2020-11-22 18:39:16 +00:00
|
|
|
schemathesis run ./services/local-orchestrator/apispec.yml --base-url=http://localhost:7673 --checks all --hypothesis-suppress-health-check too_slow
|
|
|
|
schemathesis run ./services/parser/apispec.yml --base-url=http://localhost:7672 --checks all --hypothesis-suppress-health-check too_slow
|
2020-11-21 23:40:56 +00:00
|
|
|
|
2020-10-29 04:03:05 +00:00
|
|
|
test: contrib/shunit2/shunit2 ## Run the acceptance tests for steps
|
2020-11-15 22:40:59 +00:00
|
|
|
set -e
|
2020-11-16 00:11:32 +00:00
|
|
|
@for t in $$(find $(PWD)/stdlib -iname "tests" -type d); do \
|
2020-10-28 20:31:52 +00:00
|
|
|
echo ">> Running acceptance tests for $$t"; \
|
|
|
|
for f in $$(find $$t -iname "*.sh" -type f); do \
|
2020-11-16 00:11:32 +00:00
|
|
|
DIR="$(PWD)/tmp/test-run-$${RANDOM}"; \
|
|
|
|
echo ">> Using $${DIR} for $$f"; \
|
|
|
|
mkdir -p $$DIR; \
|
|
|
|
(cd $$DIR && \
|
|
|
|
PATH="$(PWD)/target/debug:$(PATH)" "$$f"); \
|
2020-10-28 20:31:52 +00:00
|
|
|
done; \
|
|
|
|
done;
|
|
|
|
|
2021-03-03 19:34:57 +00:00
|
|
|
migrate: $(SQLITE_DB) ## Run the local SQLite migrations
|
|
|
|
sqlx migrate --source migrations/sqlite run
|
|
|
|
|
|
|
|
$(SQLITE_DB): ## Create an empty SQLite database
|
|
|
|
sqlx database create
|
|
|
|
|
|
|
|
clean-db: ## Remove the SQLite database for local development
|
|
|
|
rm -f $(SQLITE_DB)
|
|
|
|
|
|
|
|
clean: clean-db ## Clean all temporary/working files
|
2019-02-23 19:31:06 +00:00
|
|
|
|
2019-07-27 17:21:28 +00:00
|
|
|
diagram: system.png system.dot ## Generate the diagrams describing otto
|
|
|
|
dot -Tpng -o system.png system.dot
|
2019-02-23 19:31:06 +00:00
|
|
|
|
2020-11-22 18:47:13 +00:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
2020-10-29 03:56:41 +00:00
|
|
|
contrib/shunit2/shunit2:
|
2020-10-29 02:38:47 +00:00
|
|
|
git submodule update --init
|
|
|
|
|
2019-07-27 17:21:28 +00:00
|
|
|
################################################################################
|