-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
110 lines (95 loc) · 4.05 KB
/
justfile
File metadata and controls
110 lines (95 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
set shell := ["bash", "-cu"]
COMPOSE_FILE := ".workflows/.dev/compose.yml"
TUNNEL_FILE := ".workflows/.dev/compose.tunnel.yml"
PROJECT := "application"
DC := "docker compose --project-directory=.workflows/.dev --file=" + COMPOSE_FILE + " --project-name=" + PROJECT
DC_TUNNEL := DC + " --file=" + TUNNEL_FILE
dev cmd:
@just dev-{{cmd}}
dev-up:
{{DC}} up -d --build --force-recreate
@echo ""
@echo "=============================================="
@echo " Arrhes Development Environment Started"
@echo "=============================================="
@echo ""
@echo " Services:"
@echo " Website: http://localhost:5173"
@echo " API: http://localhost:3000"
@echo ""
@echo " Infrastructure:"
@echo " PostgreSQL: localhost:5432"
@echo " Mailpit: http://localhost:8025"
@echo " RustFS: http://localhost:9001"
@echo ""
@echo " Demo Credentials:"
@echo " Email: demo@arrhes.com"
@echo " Password: demo"
@echo ""
@echo " Logs: docker compose -f {{COMPOSE_FILE}} logs -f"
@echo "=============================================="
# Start dev environment with a Cloudflare tunnel for Mollie webhook testing.
# The tunnel exposes the API on a public *.trycloudflare.com URL and
# automatically sets API_BASE_URL inside the API container.
#
# How it works:
# 1. Start only the tunnel service (no dependencies, connects when API is up)
# 2. Wait for cloudflared to print the *.trycloudflare.com URL
# 3. Start all remaining services with the tunnel URL as API_BASE_URL
dev-tunnel:
@bash .workflows/.dev/tunnel.sh '{{DC_TUNNEL}}' '{{COMPOSE_FILE}}'
dev-down:
{{DC}} down --remove-orphans
dev-tunnel-down:
{{DC_TUNNEL}} down --remove-orphans
dev-reset:
@echo "Resetting database (clearing and reseeding)..."
{{DC}} exec api sh -c "cd /workspace/packages/tools && pnpm run reset"
@echo "Database reset complete."
# ==============================================================================
# Build Pipeline
# ==============================================================================
# Uses the same compose file as CI (single source of truth):
# 1. ci service: pnpm install, Biome check, unit tests, build
# 2. api/website services: production Docker images
#
# Usage:
# just build - Run CI checks only
# just build-all - Run CI checks + build production images
COMPOSE_BUILD := "docker compose -f .workflows/.build/compose.yml"
build:
@echo "=============================================="
@echo " Arrhes Build (lint + test + build)"
@echo "=============================================="
@echo ""
{{COMPOSE_BUILD}} build --progress=plain --no-cache ci
@echo ""
@echo "=============================================="
@echo " Build succeeded"
@echo "=============================================="
build-all:
@echo "=============================================="
@echo " Arrhes Full Build (ci + images)"
@echo "=============================================="
@echo ""
{{COMPOSE_BUILD}} build --progress=plain --no-cache ci
ARRHES_VERSION=$(cat VERSION) {{COMPOSE_BUILD}} build --progress=plain --no-cache api website
@echo ""
@echo "=============================================="
@echo " Build succeeded"
@echo "=============================================="
# ==============================================================================
# Tests (requires dev environment running)
# ==============================================================================
# Run all unit tests
test-unit:
{{DC}} exec api sh -c "pnpm --recursive --if-present --filter='./packages/**' run test:unit"
# Run all integration tests
test-integration:
{{DC}} exec api sh -c "pnpm --filter='@arrhes/application-api' run test:integration"
# Run all Playwright E2E tests
test-e2e:
{{DC}} exec api sh -c "pnpm run test:e2e"
# Run all tests: unit + integration + E2E
test:
{{DC}} exec api sh -c "pnpm --recursive --if-present --filter='./packages/**' run test && pnpm run test:e2e"