-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
88 lines (63 loc) · 2.1 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
87
88
.PHONY: env tests log-dirs ci ci-clean deps
ARCHIVA_USERNAME = $(shell grep access_key ~/.s3cfg | head -n1 | awk -F ' = ' '{print $$2 }')
ARCHIVA_PASSPHRASE = $(shell grep secret_key ~/.s3cfg | head -n1 | awk -F ' = ' '{print $$2}')
LEIN = HTTP_CLIENT="curl --insecure -f -L -o" lein
LEIN_ENV=ARCHIVA_USERNAME="${ARCHIVA_USERNAME}" ARCHIVA_PASSPHRASE="${ARCHIVA_PASSPHRASE}"
all: deps lein-deps bin/lein-classpath force-config-edn log-dirs checkouts/wonko-client
distclean:
rm -rf ./.m2
clean:
$(LEIN_ENV) $(LEIN) clean
lein-deps:
$(LEIN_ENV) $(LEIN) deps
rm -f bin/lein-classpath # required for end2end tests on ci
download-lein-libs: target/wonko-1.0.0.jar
target/wonko-1.0.0.jar: project.clj
$(LEIN_ENV) $(LEIN) do clean, deps
env:
@echo "ARCHIVA_USERNAME=$(ARCHIVA_USERNAME)"
@echo "ARCHIVA_PASSPHRASE=$(ARCHIVA_PASSPHRASE)"
bin/lein-classpath: project.clj
$(LEIN_ENV) ./bin/gen-lein-classpath [email protected] && mv -f [email protected] $@
force-config-edn:
rm -f resources/config.edn
make resources/config.edn
resources/config.edn: resources/config.edn.dev
cp $< $@
start-ci-services: deps
./bin/deps start zookeeper
./bin/deps start kafka
stop-ci-services:
-./bin/deps stop kafka
-./bin/deps stop zookeeper
ci: force-config-edn log-dirs checkouts/wonko-client
make start-ci-services
make tests
# FIXME
# (Probably) because of an ungraceful exit, kafka would
# encounter a conflict (INFO conflict in /brokers/ids/0 data)
# and refuse to boot on alternate runs. A quick fix is to zap
# zookeeper and kafka's data directories after every run, but
# this should be fixed to get at the real issue (probably making
# the exit more graceful).
ci-clean:
-make stop-ci-services
-rm -rf /tmp/kafka-logs
-rm -rf /tmp/zookeeper
-rm -rf ../wonko-client
tests: download-lein-libs
$(LEIN_ENV) $(LEIN) test
deps: deps-pull
./bin/deps install all
deps-check:
./bin/deps check all
deps-pull:
git submodule update --init
/var/log/wonko:
sudo mkdir -p /var/log/wonko
sudo chown -R "${USER}" /var/log/wonko/
log-dirs: /var/log/wonko
checkouts:
mkdir checkouts
checkouts/wonko-client: deps checkouts
ln -fs ../../wonko-client $@