38 lines
1.2 KiB
Makefile
38 lines
1.2 KiB
Makefile
.PHONY: check build prod-build publish
|
|
|
|
build:
|
|
$(MAKE) -C evening_detective_server build-linux
|
|
npm --prefix evening_detective_frontend run build
|
|
|
|
prod-build:
|
|
rm -rf prod/backend prod/frontend/dist prod/migrations
|
|
mkdir -p prod/backend prod/frontend/dist prod/migrations
|
|
|
|
$(MAKE) -C evening_detective_server build-linux
|
|
cp evening_detective_server/bin/evening_detective_server prod/backend/evening_detective_server
|
|
|
|
npm --prefix evening_detective_frontend run build
|
|
cp -R evening_detective_frontend/dist/. prod/frontend/dist/
|
|
|
|
cp evening_detective_server/migrations/*.sql prod/migrations/
|
|
|
|
publish:
|
|
@test -n "$(MSG)" || (echo 'Usage: make publish MSG="commit message"' >&2; exit 1)
|
|
@$(MAKE) build
|
|
@set -e; \
|
|
for repo in . evening_detective_server evening_detective_frontend; do \
|
|
git -C "$$repo" add -A; \
|
|
if git -C "$$repo" diff --cached --quiet; then \
|
|
echo "$$repo: no changes"; \
|
|
continue; \
|
|
fi; \
|
|
git -C "$$repo" commit -m "$(MSG)"; \
|
|
git -C "$$repo" push; \
|
|
done
|
|
|
|
check:
|
|
$(MAKE) -C evening_detective_server test
|
|
npm --prefix evening_detective_frontend run type-check
|
|
npm --prefix evening_detective_frontend run lint
|
|
npm --prefix evening_detective_frontend run lint:css
|