-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathsetup_ci.sh
More file actions
executable file
·71 lines (57 loc) · 1.47 KB
/
setup_ci.sh
File metadata and controls
executable file
·71 lines (57 loc) · 1.47 KB
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
#!/bin/bash
set -e
function args() {
options=$(getopt --long cratedb-version: --long sqlalchemy-version: -- "$@")
[ $? -eq 0 ] || {
echo "Incorrect options provided"
exit 1
}
eval set -- "$options"
while true; do
case "$1" in
--cratedb-version)
shift;
cratedb_version=$1
;;
--sqlalchemy-version)
shift;
sqlalchemy_version=$1
;;
--)
shift
break
;;
esac
shift
done
}
function main() {
# Read command line arguments.
args $0 "$@"
# Sanity checks.
[ -z ${cratedb_version} ] && {
echo "--cratedb-version must be given"
exit 1
}
[ -z ${sqlalchemy_version} ] && {
echo "--sqlalchemy-version must be given"
exit 1
}
# Let's go.
echo "Invoking tests with CrateDB ${cratedb_version} and SQLAlchemy ${sqlalchemy_version}"
python -m pip install --upgrade pip
# Workaround needed for Python 3.5
python -m pip install --upgrade "setuptools>=31,<51"
pip install zc.buildout==2.13.4
# Replace SQLAlchemy version.
sed -ir "s/SQLAlchemy.*/SQLAlchemy = ${sqlalchemy_version}/g" versions.cfg
# Replace CrateDB version.
if [ ${cratedb_version} = "nightly" ]; then
sed -ir "s/releases/releases\/nightly/g" base.cfg
sed -ir "s/crate_server.*/crate_server = latest/g" versions.cfg
else
sed -ir "s/crate_server.*/crate_server = ${cratedb_version}/g" versions.cfg
fi
buildout -n -c base.cfg
}
main "$@"