forked from luarocks/luarocks-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.sh
executable file
·39 lines (31 loc) · 1.31 KB
/
ci.sh
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
#!/bin/bash
set -e
set -o pipefail
set -o xtrace
# setup lua
luarocks --lua-version=5.1 install --local cloud_storage
luarocks --lua-version=5.1 install --local https://luarocks.org/manifests/leafo/lapis-dev-1.rockspec
luarocks --lua-version=5.1 install --local https://raw.githubusercontent.com/moteus/ZipWriter/master/rockspecs/zipwriter-0.1.2-1.rockspec
luarocks --lua-version=5.1 install --local moonrocks
luarocks --lua-version=5.1 install --local https://raw.githubusercontent.com/leafo/tableshape/master/tableshape-dev-1.rockspec
eval $(luarocks --lua-version=5.1 path)
# prepare secrets
cp -r secret_example secret
echo "config 'test', -> logging false" >> config.moon
# build
tup init && tup generate build.sh && ./build.sh
cat $(which busted) | sed 's/\/usr\/bin\/lua5\.1/\/usr\/bin\/luajit/' > busted
chmod +x busted
# start postgres
echo "fsync = off" >> /var/lib/postgres/data/postgresql.conf
echo "synchronous_commit = off" >> /var/lib/postgres/data/postgresql.conf
echo "full_page_writes = off" >> /var/lib/postgres/data/postgresql.conf
su postgres -c '/usr/bin/pg_ctl -s -D /var/lib/postgres/data start -w -t 120'
make init_schema
make migrate
make test_db
# mkdir -p logs
# touch logs/notice.log
# tail -f logs/notice.log &
echo 'user root;' >> nginx.conf
LAPIS_NOTICE_LOG=logs/notice.log ./busted -o utfTerminal