-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
86 lines (71 loc) · 1.63 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.PHONY: clean test test-clj
# Based on: /~https://github.com/den1k/vimsical/blob/master/Makefile
#
# Deps
#
deps:
lein deps
#
# Lein
#
clean:
lein clean
#
# Test
#
test: test-clj
test-clj: clean
lein test
#
# Build
#
build: build-clj
build-clj: clean
lein uberjar
#
# Setup credentials
#
infra-credentials:
ifeq ($(DATOMIC_LOGIN),)
$(error DATOMIC_LOGIN is undefined)
endif
ifeq ($(DATOMIC_PASSWORD),)
$(error DATOMIC_PASSWORD is undefined)
endif
ifeq ($(DATOMIC_LICENSE_KEY),)
$(error DATOMIC_LICENSE_KEY is undefined)
endif
ifeq ($(DATOMIC_VERSION),)
$(error DATOMIC_VERSION is undefined)
endif
ifeq ($(STORAGE_ADMIN_PASSWORD),)
$(error STORAGE_ADMIN_PASSWORD is undefined)
endif
ifeq ($(STORAGE_DATOMIC_PASSWORD),)
$(error STORAGE_DATOMIC_PASSWORD is undefined)
endif
echo "DATOMIC_LOGIN=${DATOMIC_LOGIN}" >> infra/.env
echo "DATOMIC_PASSWORD=${DATOMIC_PASSWORD}" >> infra/.env
echo "DATOMIC_LICENSE_KEY=${DATOMIC_LICENSE_KEY}" >> infra/.env
echo "DATOMIC_VERSION=${DATOMIC_VERSION}" >> infra/.env
echo "STORAGE_ADMIN_PASSWORD=${STORAGE_ADMIN_PASSWORD}" >> infra/.env
echo "STORAGE_DATOMIC_PASSWORD=${STORAGE_DATOMIC_PASSWORD}" >> infra/.env
echo "{:datomic-secret-password \"${STORAGE_DATOMIC_PASSWORD}\"}" >> .lein-env
infra-start: infra/.env
cd infra && docker-compose up -d
infra-logs:
cd infra && docker-compose logs -f
infra-build: build
cd infra && docker-compose build --no-cache datomic console
infra-stop:
cd infra && docker-compose down -v --remove-orphans
infra-run: infra-start infra-logs
#
# Start Backend and Infra
#
run: infra-start
lein run
#
# Clean deps, project and run server
#
rebuild: clean deps build run