-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
135 lines (105 loc) · 4.72 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
SHELL=/bin/bash
EXEC=`test -d .stack-work/ && echo "stack exec --allow-different-user --" || echo "cabal exec --"`
HLINT=$(EXEC) hlint
AULA_AUTOGEN_PATH=`dirname \`find ./.stack-work/ ./dist/build/ -path '*build/autogen/Paths_aula.hs'\``
AULA_SOURCES=-isrc -itests -iexec -i$(AULA_AUTOGEN_PATH)
AULA_IMAGE=quay.io/liqd/aula:aula-docker-0.4
.phony:
# use sensei if you only want to hack aula.
#
# [fisx] the unregister rules are a hack: i experienced problems with
# getting changes to source files noticed when any of the packages i
# was sensei-ing were installed in the sandbox. since i am
# unregistering them as a precondition of the sensei rules, that
# problem went away. (more data on this or hypotheses on the source
# of the problem are always welcome.)
%.unregister:
-$(EXEC) ghc-pkg unregister $*
sensei: .phony aula.unregister
$(EXEC) sensei -j5 $(AULA_SOURCES) tests/Spec.hs $(SENSEI_DEFAULT_ARGS) $(SENSEI_ARGS) --skip @Large --skip @Selenium
selenium: .phony aula.unregister
$(EXEC) sensei -j5 $(AULA_SOURCES) tests/Spec.hs $(SENSEI_DEFAULT_ARGS) $(SENSEI_ARGS) --match @Selenium
sensei-large: .phony aula.unregister
$(EXEC) sensei -j5 $(AULA_SOURCES) -optP-DDEVELOPMENT ./tests/Spec.hs $(SENSEI_DEFAULT_ARGS) $(SENSEI_ARGS)
stories: .phony aula.unregister
$(EXEC) sensei -j5 $(AULA_SOURCES) tests/AulaTests/StoriesSpec.hs $(SENSEI_DEFAULT_ARGS) $(SENSEI_ARGS) --skip @Large
seito: .phony
sleep 0.2 && seito
seito-docker: .phony
pwd > pwd.log
docker exec -it `docker ps -q --filter="ancestor=$(AULA_IMAGE)"` /liqd/aula/docker/make-seito.sh
aula-server: .phony
$(EXEC) runhaskell -j5 $(AULA_SOURCES) ./exec/Aula.hs
click-dummies-recreate: .phony
@echo "*** this target is deprecated!"
@echo "*** you need pre-created sample sources to use click-dummies-refresh now."
@echo "*** see module docs in src/RenderHtml.hs"
click-dummies-refresh: .phony aula.unregister
$(EXEC) sensei $(AULA_SOURCES) ./exec/RenderHtml.hs
test-repl:
$(EXEC) ghci $(AULA_SOURCES)
hlint:
$(HLINT) --version
find src exec tests -name '*.hs' | xargs $(HLINT)
test-everything:
make hlint
cabal install --enable-test --ghc-options="-Werror -Wall -O0"
cabal test
ghci-no-type-errors:
$(EXEC) ghci $(AULA_SOURCES) -fdefer-type-errors
wc:
find src tests -name '*.hs' | xargs wc
content-login: .phony
rm -f cookie-jar
[ "$(AULA_MK_CONTENT_URL)" != "" ] || ( echo "set with e.g. 'export AULA_MK_CONTENT_URL=http://localhost:8080'"; false )
curl -L -v -c cookie-jar -F /login.user=admin -F /login.pass=pssst $(AULA_MK_CONTENT_URL)/login
test-wipe-ideas-and-topics:
make content-login
curl -L -v -b cookie-jar -XPOST $(AULA_MK_CONTENT_URL)/api/manage-state/wipe
rm -f cookie-jar
content:
curl -XPOST $(AULA_MK_CONTENT_URL)/api/manage-state/create-init
make content-login
curl -L -v -b cookie-jar -XPOST $(AULA_MK_CONTENT_URL)/api/manage-state/create-demo
curl -L -v -b cookie-jar -XPOST $(AULA_MK_CONTENT_URL)/api/manage-state/create-votes
rm -f cookie-jar
content-deleg:
make content-login
curl -L -v -b cookie-jar -XPOST $(AULA_MK_CONTENT_URL)/api/manage-state/create-delegations
rm -f cookie-jar
fix-content:
make content-login
curl -L -v -b cookie-jar -XPOST $(AULA_MK_CONTENT_URL)/api/manage-state/fix
rm -f cookie-jar
testrenameclass:
make content-login
curl -L -v -b cookie-jar -XPOST $(AULA_MK_CONTENT_URL)/admin/class/2016-wef-wef-wef/edit
rm -f cookie-jar
testcsvclass:
make content-login
curl -L -v -b cookie-jar -O -v $(AULA_MK_CONTENT_URL)/admin/downloads/passwords/2016-wef-wef-wef/csv
rm -f cookie-jar
testxlsxclass:
make content-login
curl -L -v -b cookie-jar -O -v $(AULA_MK_CONTENT_URL)/admin/downloads/passwords/2016-wef-wef-wef/xlsx
rm -f cookie-jar
tags: .phony
hasktags -b src/ tests/ exec/
grepi.%:
git grep -Hni $* src tests exec
grep.%:
git grep -Hn $* src tests exec
docker-hpc:
./.travis/docker-build.sh 1000
cp -R /liqd/aula/.stack-work/install/x86_64-linux/lts-3.20/7.10.2/hpc .
team-avatars: .phony
-rm -r team-avatars
mkdir team-avatars
curl -o team-avatars/andorp https://avatars1.githubusercontent.com/u/3465327?v=3&s=400
curl -o team-avatars/fisx https://avatars2.githubusercontent.com/u/10210727?v=3&s=400
curl -o team-avatars/np https://avatars3.githubusercontent.com/u/5548?v=3&s=400
curl -o team-avatars/rittermo https://avatars3.githubusercontent.com/u/15341015?v=3&s=400
curl -o team-avatars/localgrr https://avatars1.githubusercontent.com/u/701632?v=3&s=400
curl -o team-avatars/mikolaj https://avatars1.githubusercontent.com/u/281893?v=3&s=400
$(EXEC) runhaskell -j5 $(AULA_SOURCES) ./exec/ResizeAvatar.hs 300 100 64 32 -- ./team-avatars/andorp ./team-avatars/fisx ./team-avatars/localgrr ./team-avatars/mikolaj ./team-avatars/np ./team-avatars/rittermo
@echo "Open now your web browser on: file://$$PWD/avatars.html"