-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart.sh
executable file
·59 lines (50 loc) · 972 Bytes
/
start.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash -e
. ./print.sh
clean=false
build=false
test=false
clean() {
if $clean; then
print "Removing containers"
docker compose rm -fs
fi
}
build() {
if $build; then
print "Building containers"
docker compose build
fi
}
test() {
if $test; then
print "Running tests"
docker compose run driver busted --lua=luajit
fi
}
cassandra() {
print "Waiting for Cassandra"
docker compose up cassandra --wait --quiet-pull
print "Seeding Cassandra"
for file in $(find integration -name '*.cql' | sort); do
cat $file | docker compose exec -T cassandra cqlsh -u cassandra -p cassandra
echo $file
done
}
run_flags() {
while getopts 'cbt' option; do
case $option in
c) clean=true ;;
b) build=true ;;
t) test=true ;;
?) exit 1 ;;
esac
done
}
run() {
clean
build
cassandra
test
}
run_flags "$@"
run