Files
tink-demo/Makefile
Henrik Jess Nielsen e3fa08f6fb
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
excluded resolver
2026-05-22 18:33:54 +02:00

51 lines
1.4 KiB
Makefile

.PHONY: install run dev docker-build docker-up docker-down push deploy logs vault-setup test clean
REGISTRY = registry.i80.dk
IMAGE = $(REGISTRY)/moneycapp-tink-demo
install:
python3 -m venv .venv && .venv/bin/pip install -q -r requirements.txt
cp -n .env.example .env || true
@echo "✓ Done — edit .env with your Tink credentials"
run:
.venv/bin/uvicorn src.main:app --host 0.0.0.0 --port 8000
dev:
.venv/bin/uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload
docker-build:
docker build -t moneycapp-tink-demo .
docker-up:
docker compose up
docker-down:
docker compose down
# --- Deploy to i80.dk ---
push:
docker build --platform linux/amd64 -t $(IMAGE):latest .
docker push $(IMAGE):latest
@echo "✓ Image pushed to $(IMAGE):latest"
vault-setup:
@echo "Storing Tink credentials in Vault..."
vault kv put secret/moneycapp-tink-demo \
client_id=$(TINK_CLIENT_ID) \
client_secret=$(TINK_CLIENT_SECRET) \
session_secret=$$(openssl rand -hex 32)
@echo "✓ Vault secret stored at secret/moneycapp-tink-demo"
deploy: push
scp moneycapp-tink-demo.nomad autobox.i80.dk:/tmp/
ssh autobox.i80.dk 'export NOMAD_ADDR=https://nomad.i80.dk:4646 && nomad job run /tmp/moneycapp-tink-demo.nomad'
@echo "✓ Deployed — https://tink-demo.i80.dk"
logs:
ssh autobox.i80.dk 'export NOMAD_ADDR=https://nomad.i80.dk:4646 && nomad alloc logs -job moneycapp-tink-demo'
clean:
rm -rf .venv __pycache__ src/__pycache__ src/**/__pycache__