-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.sh
executable file
·52 lines (40 loc) · 1.09 KB
/
build.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
#!/bin/bash
set -e
set -u
export PREFIX=${TRAVIS_BRANCH:-test}
if [ -n "${DOCKER_USERNAME:-}" -a -z "${REPO:-}" ]; then
REPO="${DOCKER_USERNAME}"
else
REPO="${REPO:-test}"
fi
IMAGE=$REPO/omero-web:$PREFIX
STANDALONE=$REPO/omero-web-standalone:$PREFIX
CLEAN=${CLEAN:-y}
cleanup() {
docker rm -f -v $PREFIX-web
}
if [ "$CLEAN" = y ]; then
trap cleanup ERR EXIT
fi
cleanup || true
make VERSION="$PREFIX" REPO="$REPO" docker-build
docker run -d --name $PREFIX-web \
-e CONFIG_omero_web_server__list='[["omero.example.org", 4064, "test-omero"]]' \
-e CONFIG_omero_web_debug=true \
-p 4080:4080 \
$IMAGE
bash test_getweb.sh
# Standalone image
cleanup
docker run -d --name $PREFIX-web \
-e CONFIG_omero_web_server__list='[["omero.example.org", 4064, "test-omero"]]' \
-e CONFIG_omero_web_debug=true \
-p 4080:4080 \
$STANDALONE
bash test_getweb.sh
if [ -n "${DOCKER_USERNAME:-}" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
make VERSION="$PREFIX" REPO="$REPO" docker-push
else
echo Docker push disabled
fi