-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathJustfile
More file actions
52 lines (39 loc) · 1.32 KB
/
Justfile
File metadata and controls
52 lines (39 loc) · 1.32 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
set dotenv-load := true
docker_image := 'stack.im'
docker_opts := '--rm -e DATABASE_URL -p 8080:8080'
docker_test_image := docker_image + '-test'
docker_test_opts := '--rm -v $(pwd):/build'
# List all available tasks
[private]
default:
@just -l
# Run the web application
run: build
docker run {{docker_opts}} {{docker_image}}
# Open a shell into the application's Docker container
sh: build-test
docker run {{docker_test_opts}} -it --entrypoint=/bin/sh {{docker_test_image}}
# Run the test suite
test: build-test
docker run {{docker_test_opts}} {{docker_test_image}}
# Open up a Clojure REPL
repl: build-test
docker run {{docker_test_opts}} -it {{docker_test_image}} repl
# Check Clojure code for formatting errors
lint:
docker run {{docker_test_opts}} {{docker_test_image}} cljfmt check
# Format Clojure code
fmt: build-test
docker run {{docker_test_opts}} {{docker_test_image}} cljfmt fix
# Run the web application and supporting infrastructure
run-compose:
docker compose up --build
# Connect to the local Postgres database
psql:
psql "postgres://stackim:stackim@localhost:${POSTGRES_PORT:-5432}/stackim"
# Build the web application's Docker image
build:
docker build -t {{docker_image}} .
# Build the web application's test environment
build-test:
docker build -f docker/test/Dockerfile -t {{docker_image}}-test .