-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (44 loc) · 1.89 KB
/
Makefile
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
docker-directory = ./docker
docker-compose-file = $(docker-directory)/docker-compose.yml
frontend:
# Note: The && here is important, otherwise it won't execute in that directory, because the Makefile does not keep
# track of its environment
cd wishlist-frontend && lein do clean, shadow watch client
start-backend: docker/down docker/rebuild
docker-compose -f $(docker-compose-file) up -d
dev/setup-images:
mkdir -p env/dev/resources/public/img/front_matters || true
ln -srf env/dev/resources/front_matters/*.jpg env/dev/resources/public/img/front_matters/
dev/backend: docker/down docker/database dev/setup-images ring-server
# Runs a local server on port 3000
# This has the advantage of updating changes made to it in real-time, while Docker would need to be restarted all the
# time.
ring-server:
lein run
docker/rebuild: docker/down
docker-compose -f $(docker-compose-file) build jetty-ring
docker/database:
docker-compose -f $(docker-compose-file) up -d database adminer
docker/down:
docker-compose -f $(docker-compose-file) down
prod/build:
lein uberjar
# This runs the "prod" environment "locally". By locallly, we mean that it's run on this PC with *some* settings /
# environment variables set like it is done for dev.
# Concretely, the database is set up s.t. it accesses the local one. Other things are however not set up, e.g. the
# front_matters dir.
prod/run-locally: prod/build
chmod +x ./target/uberjar/bookstore.jar
DATABASE_URL='jdbc:postgresql://localhost:5432/books_dev?user=pguser&password=3ZmW9M38mX8AQGqBP' ./target/uberjar/bookstore.jar
clean:
# Remove all images that are not associated with a container
docker system prune
### Tests ###
# This runs only the tests that are neither :amazon, nor :integration, as is defined in project.clj
test:
lein test
test-amazon:
lein test :amazon
test-integration:
lein test :integration
test-all: test test-amazon test-integration