🧱 add tests & ci changes
All checks were successful
CI / Lint (push) Successful in 21s
CI / Helm Lint (push) Successful in 6s
CI / Build (push) Successful in 1m48s
CI / Test (push) Successful in 44s

This commit is contained in:
Christian van Dijk
2026-02-23 22:52:54 +01:00
parent dbbe991a3d
commit 59ddc66a8e
10 changed files with 309 additions and 72 deletions

View File

@@ -1,39 +1,51 @@
.PHONY: init-db dev build clean logs down
.PHONY: run test lint deps init-db dev build logs logs-worker logs-all down shell-postgres shell-api shell-worker status
# Docker Compose: use parent dir's compose file (when run via make -C devices-api)
COMPOSE := docker-compose -f ../docker-compose.yml
run:
lua app-standalone.lua
test:
lua run_tests.lua
lint:
luacheck . --codes
deps:
luarocks install lua-cjson luasocket pgmoon redis-lua luaossl
# Docker Compose targets (run from project root: make -C devices-api <target>)
init-db:
docker-compose exec postgres psql -U devices_user -d handheld_devices -f /docker-entrypoint-initdb.d/001_create_devices.sql
$(COMPOSE) exec postgres psql -U devices_user -d handheld_devices \
-f /docker-entrypoint-initdb.d/001_create_devices.sql
dev up:
$(COMPOSE) up -d
build:
docker-compose build
dev:
docker-compose up -d
$(COMPOSE) build
logs:
docker-compose logs -f api
$(COMPOSE) logs -f api
logs-worker:
docker-compose logs -f worker
$(COMPOSE) logs -f worker
logs-all:
docker-compose logs -f
$(COMPOSE) logs -f
down:
docker-compose down
down-volumes:
docker-compose down -v
$(COMPOSE) down
shell-postgres:
docker-compose exec postgres psql -U devices_user -d handheld_devices
$(COMPOSE) exec postgres psql -U devices_user -d handheld_devices
shell-api:
docker-compose exec api sh
$(COMPOSE) exec api sh
shell-worker:
docker-compose exec worker sh
clean: down-volumes
$(COMPOSE) exec worker sh
status:
docker-compose ps
$(COMPOSE) ps