-
Notifications
You must be signed in to change notification settings - Fork 15
/
ci-build
executable file
·64 lines (48 loc) · 1.93 KB
/
ci-build
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
#! /bin/bash
set -e
set -u
set -x
python setup.py test -t test/unit -v
python setup.py test -t test/integration -v -m "not slowtest"
python setup.py sdist install
pip install dist/*.tar.gz
omego version
omego -h
#Install a new server without web
#Tests rely on a non-zero error code being returned on failure
if [ $TEST = install ]; then
export OMERODIR='./OMERO.server-5.6.4-ice36-b232'
omego install --initdb --dbhost localhost --dbname omero --prestartfile $HOME/config.omero -v --release 5.6.4 --ice 3.6 --no-web --no-start
ls OMERO.server
# Should return 0 DB_UPTODATE
omego db upgrade -n --dbhost localhost --dbname omero --serverdir OMERO.server
# Check the expected server version was downloaded
test $(readlink OMERO.server) = $OMERODIR
# Check db dump file
omego db dump --serverdir OMERO.server --dumpfile omero.pgdump
pg_restore -l omero.pgdump | grep 'dbpatch_versions_trigger'
fi
#Test a multistage DB upgrade (5.3 -> 5.4) as part of the server upgrade
if [ $TEST = upgrade ]; then
omego download --release 5.3 --ice 3.6 server
ln -s OMERO.server-5.3.5-ice36-b73 OMERO.server;
# Should return 3 DB_INIT_NEEDED
RC=0;
omego db upgrade -n --dbname omero --serverdir OMERO.server || RC=$?
test $RC -eq 3
OMERO.server/bin/omero db script "" "" ome -f OMERO.sql;
psql -q -h localhost -U omero omero < OMERO.sql;
OMERO.server/bin/omero load $HOME/config.omero;
OMERO.server/bin/omero admin start;
# Should return 0 DB_UPTODATE
omego db upgrade -n --serverdir OMERO.server
omego download --release 5.5 --ice 3.6 server --sym download-server-50
# Should return 2 DB_UPGRADE_NEEDED
RC=0;
omego db upgrade -n --dbname omero --serverdir download-server-50 || RC=$?
test $RC -eq 2
# Note this should use the already downloaded zip from the previous step
omego install --upgrade --managedb --release=5.5 --ice 3.6 --no-web
# Should return 0 DB_UPTODATE
omego db upgrade -n --serverdir OMERO.server
fi