-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
59 lines (44 loc) · 1.41 KB
/
justfile
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
current-dir := invocation_directory()
alias test := _test-all
dev $COURSEFULL_ENV='Dev':
bin/dev
populate:
cd client && \
op run --env-file={{current-dir}}/.env.tpl \
-- pnpm populate
test-playwright-single test-name $COURSEFULL_ENV='test':
cd client && \
op run --env-file={{current-dir}}/.env.tpl \
-- pnpm exec playwright test {{test-name}}.spec.ts --trace on
test-frontend $COURSEFULL_ENV='Test': _check-test-server
cd client && \
op run --env-file={{current-dir}}/.env.tpl \
-- pnpm build
cp -r client/out/* public/
cd client && \
op run --env-file={{current-dir}}/.env.tpl \
-- pnpm test
test-backend $COURSEFULL_ENV='Test': _check-test-server
op run --env-file={{current-dir}}/.env.tpl \
-- bundle exec rspec
_test-all: _check-test-server test-backend test-frontend
_check-test-server:
nc -z localhost 5100
_setup-test-database:
docker compose -f test.docker-compose.yml up -d
_teardown-test-database:
docker compose -f test.docker-compose.yml down
test-server: _setup-test-database && _teardown-test-database
bin/test-server
_test-server:
echo "Waiting for Postgres..."
sleep 3
echo "Postgres started"
rails db:create
rails db:migrate
rails db:test:prepare
rails db:seed
cd client && pnpm run build
cd ..
cp -r client/out/* public/
foreman start -f Procfile.test